-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bab9419
commit 4b128f4
Showing
1 changed file
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |