Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace deprecated pkg_resources with importlib #256

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading