From 4b128f4e49bdc12c7d38f478eaf155702f51195f Mon Sep 17 00:00:00 2001 From: Tyler Sutterley Date: Wed, 15 Nov 2023 08:33:54 -0800 Subject: [PATCH] fix: replace deprecated `pkg_resources` with `importlib` (#256) --- pyTMD/version.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pyTMD/version.py b/pyTMD/version.py index 119fa173..26e046eb 100644 --- a/pyTMD/version.py +++ b/pyTMD/version.py @@ -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"]