diff --git a/src/datajudge/__init__.py b/src/datajudge/__init__.py index 546a1198..5d404f53 100644 --- a/src/datajudge/__init__.py +++ b/src/datajudge/__init__.py @@ -1,7 +1,7 @@ """datajudge allows to assess whether data from database complies with reference information.""" -import pkg_resources +import importlib.metadata from .constraints.base import Constraint from .db_access import Condition @@ -16,6 +16,6 @@ ] try: - __version__ = pkg_resources.get_distribution(__name__).version + __version__ = importlib.metadata.distribution(__name__).version except Exception: __version__ = "1.8.0" diff --git a/src/datajudge/pytest_integration.py b/src/datajudge/pytest_integration.py index c6cf6c02..dabb0526 100644 --- a/src/datajudge/pytest_integration.py +++ b/src/datajudge/pytest_integration.py @@ -1,7 +1,7 @@ from typing import Iterable import pytest -from pkg_resources import parse_version +from packaging.version import Version from .constraints.base import Constraint from .db_access import apply_patches @@ -22,7 +22,7 @@ def get_formatter(pytestconfig): try: import pytest_html - if parse_version(pytest_html.__version__).major >= 4: + if Version(pytest_html.__version__).major >= 4: return AnsiColorFormatter() finally: return Formatter()