Skip to content

Commit

Permalink
use importlib.metadata
Browse files Browse the repository at this point in the history
for version introspection, closes #93
  • Loading branch information
duncanmmacleod authored and johnveitch committed Jul 23, 2024
1 parent a8fc326 commit f5a0754
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpnest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
from .cpnest import CPNest

# Get the version number from git tag
from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version as distribution_version
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
__version__ = distribution_version(__name__)
except ModuleNotFoundError:
# package is not installed
__version__ = "dev"

Expand Down

0 comments on commit f5a0754

Please sign in to comment.