Skip to content

Commit

Permalink
build: use pkg_resources for doc version
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-urdin committed Jun 28, 2022
1 parent 734095a commit afcf990
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions doc/source/conf.py
Expand Up @@ -11,7 +11,7 @@
# serve to show the default.

import datetime
import subprocess
import pkg_resources

# 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,9 +51,8 @@
# built documents.
#
# The short X.Y version.
version = subprocess.Popen(['sh', '-c', 'cd ../..; python setup.py --version'],
stdout=subprocess.PIPE).stdout.read()
version = version.strip()
version = pkg_resources.get_distribution('gnocchiclient').version

# The full version, including alpha/beta/rc tags.
release = version

Expand Down
2 changes: 1 addition & 1 deletion gnocchiclient/version.py
Expand Up @@ -16,7 +16,7 @@


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

0 comments on commit afcf990

Please sign in to comment.