Skip to content

Commit 8587a05

Browse files
authored
Remove deprecated pkg_resources. (#231)
1 parent 1e23940 commit 8587a05

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/datajudge/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""datajudge allows to assess whether data from database complies with reference
22
information."""
33

4-
import pkg_resources
4+
import importlib.metadata
55

66
from .constraints.base import Constraint
77
from .db_access import Condition
@@ -16,6 +16,6 @@
1616
]
1717

1818
try:
19-
__version__ = pkg_resources.get_distribution(__name__).version
19+
__version__ = importlib.metadata.distribution(__name__).version
2020
except Exception:
2121
__version__ = "1.8.0"

src/datajudge/pytest_integration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Iterable
22

33
import pytest
4-
from pkg_resources import parse_version
4+
from packaging.version import Version
55

66
from .constraints.base import Constraint
77
from .db_access import apply_patches
@@ -22,7 +22,7 @@ def get_formatter(pytestconfig):
2222
try:
2323
import pytest_html
2424

25-
if parse_version(pytest_html.__version__).major >= 4:
25+
if Version(pytest_html.__version__).major >= 4:
2626
return AnsiColorFormatter()
2727
finally:
2828
return Formatter()

0 commit comments

Comments
 (0)