Skip to content

Commit

Permalink
refactor: replace pkg_resources with importlib.metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Jul 10, 2023
1 parent 8b458b1 commit 41a6e00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/ga4gh/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import warnings
from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version, PackageNotFoundError

from ._internal.digests import sha512t24u
from ._internal.enderef import ga4gh_enref, ga4gh_deref
Expand All @@ -14,8 +14,8 @@
is_curie, is_identifiable, is_literal, pjs_copy)

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound: # pragma: nocover
__version__ = version(__name__)
except PackageNotFoundError: # pragma: nocover
__version__ = "unknown"
finally:
del get_distribution, DistributionNotFound
del version, PackageNotFoundError
8 changes: 4 additions & 4 deletions src/ga4gh/vrs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
__all__ = """models normalize schema_path vrs_deref vrs_enref""".split()


from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version, PackageNotFoundError

from ._internal.enderef import vrs_deref, vrs_enref
from ._internal.models import models, schema_path
from .normalize import normalize

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound: # pragma: nocover
__version__ = version(__name__)
except PackageNotFoundError: # pragma: nocover
__version__ = "unknown"
finally:
del get_distribution, DistributionNotFound
del version, PackageNotFoundError

0 comments on commit 41a6e00

Please sign in to comment.