Skip to content

Commit

Permalink
Remove python 3.8 workaround in tests. (#560)
Browse files Browse the repository at this point in the history
Support for python was dropped in #559
  • Loading branch information
vimalloc authored Nov 18, 2024
1 parent f005c11 commit 49cf2e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
17 changes: 2 additions & 15 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import importlib.metadata
import json
import sys
from datetime import date
from datetime import timedelta

Expand All @@ -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(".")))


Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ deps =
python-dateutil
types-python-dateutil
mypy
types-setuptools

[testenv:coverage]
commands =
Expand Down

0 comments on commit 49cf2e9

Please sign in to comment.