Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove python 3.8 workaround in tests. #560

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading