From ed3e92c7dcd18ee886530083ac89f8bbcdd36d49 Mon Sep 17 00:00:00 2001 From: Lily Acadia Gilbert Date: Mon, 18 Nov 2024 10:34:14 -0700 Subject: [PATCH] Remove python 3.8 workaround in tests. Support for python was dropped in #559 --- tests/test_config.py | 17 ++--------------- tox.ini | 1 - 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index fa938795..1d01e302 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,5 +1,5 @@ +import importlib.metadata import json -import sys from datetime import date from datetime import timedelta @@ -12,20 +12,7 @@ from flask_jwt_extended.internal_utils import JSONEncoder -def get_package_version(package_name): - if sys.version_info >= (3, 8): - # Use importlib.metadata for Python 3.8 and newer - import importlib.metadata - - return importlib.metadata.version(package_name) - else: - # Use pkg_resources for older versions - import pkg_resources - - return pkg_resources.get_distribution(package_name).version - - -flask_version = get_package_version("flask") +flask_version = importlib.metadata.version("flask") flask_version_tuple = tuple(map(int, flask_version.split("."))) diff --git a/tox.ini b/tox.ini index 5185d1e5..653d6eb0 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,6 @@ deps = python-dateutil types-python-dateutil mypy - types-setuptools [testenv:coverage] commands =