Skip to content

Commit

Permalink
Update how we access importlib metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jschaff committed Oct 28, 2024
1 parent 4504cf7 commit 691461a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions biothings_client/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import importlib.metadata
"""
Package versioning using PEP-376
https://peps.python.org/pep-0396/#pep-376-metadata
"""

# https://peps.python.org/pep-0396/#pep-376-metadata
distribution_name = "biothings_client"
__version__ = importlib.metadata.version(distribution_name)
try:
from importlib import metadata
except ImportError:
# Running on pre-3.8 Python; use importlib-metadata package
import importlib_metadata as metadata # type: ignore

DISTRIBUTION_NAME = "biothings_client"
__version__ = metadata.version(DISTRIBUTION_NAME)

0 comments on commit 691461a

Please sign in to comment.