Skip to content

Commit

Permalink
Move to importlib (pkg_resources is deprecated)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalrussell committed Nov 13, 2023
1 parent b1cf234 commit 7ab10c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/snkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""snkit - a spatial networks toolkit
"""
import pkg_resources
from importlib.metadata import version, PackageNotFoundError

# Define what is accessible directly on snkit, when a client writes::
# from snkit import Network
Expand All @@ -12,8 +12,8 @@


try:
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
__version__ = version(__name__)
except (PackageNotFoundError, ValueError):
__version__ = "unknown"


Expand Down

0 comments on commit 7ab10c0

Please sign in to comment.