summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2018-10-18 10:25:21 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2018-10-18 10:25:21 +0300
commit7049c2c3e04d3d42c901606381092b1d26d973cd (patch)
tree0edd0ea57102a85080eb814064a9d0c06b7a6371
parenta7a724e9ac1ad018c1d28b52bbeb860c1799d084 (diff)
downloadwheel-git-7049c2c3e04d3d42c901606381092b1d26d973cd.tar.gz
Switched to an alternate style for getting the wheel version string
There was a problem getting the version from the correct place on ReadTheDocs and this attempts to fix that.
-rw-r--r--docs/conf.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/docs/conf.py b/docs/conf.py
index e9a5b35..18a29b9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -10,8 +10,9 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
-
-import pkg_resources
+import io
+import os
+import re
# 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
@@ -47,10 +48,16 @@ copyright = u'2012, Daniel Holth'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-# The short X.Y version.
-version = pkg_resources.working_set.by_key['wheel'].version
-# The full version, including alpha/beta/rc tags.
-release = version
+here = os.path.abspath(os.path.dirname(__file__))
+with io.open(os.path.join(here, '..', 'wheel', '__init__.py'),
+ encoding='utf8') as version_file:
+ match = re.search(r'__version__ = "((\d+\.\d+\.\d+).*)"',
+ version_file.read())
+ # The short X.Y version.
+ version = match.group(2)
+
+ # The full version, including alpha/beta/rc tags.
+ release = match.group(1)
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.