Skip to content

Commit

Permalink
Merge pull request #144 from kajinamit/pkg_resources
Browse files Browse the repository at this point in the history
Get rid of pkg_resources
  • Loading branch information
tobias-urdin authored Oct 14, 2024
2 parents c8795bc + 0f386b6 commit 9b9f8e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# serve to show the default.

import datetime
import pkg_resources
import importlib.metadata

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -51,7 +51,7 @@
# built documents.
#
# The short X.Y version.
version = pkg_resources.get_distribution('gnocchiclient').version
version = importlib.metadata.version('gnocchiclient')

# The full version, including alpha/beta/rc tags.
release = version
Expand Down
6 changes: 3 additions & 3 deletions gnocchiclient/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
# under the License.
#

import pkg_resources
import importlib.metadata


try:
__version__ = pkg_resources.get_distribution('gnocchiclient').version
except pkg_resources.DistributionNotFound:
__version__ = importlib.metadata.version('gnocchiclient')
except importlib.metadata.PackageNotFoundError:
# package is not installed
pass

0 comments on commit 9b9f8e8

Please sign in to comment.