Skip to content

Commit

Permalink
fix: replace deprecated pkg_resources with importlib (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutterley authored Nov 15, 2023
1 parent bab9419 commit 4b128f4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pyTMD/version.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/usr/bin/env python
u"""
version.py (04/2021)
version.py (11/2023)
Gets semantic version number and commit hash from setuptools-scm
"""
from pkg_resources import get_distribution
import importlib.metadata

# get semantic version from setuptools-scm
version = get_distribution("pyTMD").version
# package metadata
metadata = importlib.metadata.metadata("pyTMD")
# get version
version = metadata["version"]
# append "v" before the version
full_version = f"v{version}"
full_version = "v{0}".format(version)
# get project name
project_name = get_distribution("pyTMD").project_name
project_name = metadata["Name"]

0 comments on commit 4b128f4

Please sign in to comment.