Skip to content

Commit

Permalink
Remove deprecated pkg_resources. (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
kklein committed Jun 25, 2024
1 parent 54b9d12 commit 2039440
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/datajudge/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,6 +16,6 @@
]

try:
__version__ = pkg_resources.get_distribution(__name__).version
__version__ = importlib.metadata.distribution(__name__).version
except Exception:
__version__ = "1.8.0"
4 changes: 2 additions & 2 deletions src/datajudge/pytest_integration.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 2039440

Please sign in to comment.