Skip to content

Commit 284b28b

Browse files
committed
[doc/conf] Import proper pkg version number
1 parent 923cea8 commit 284b28b

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

doc/conf.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,22 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14+
import json
1415
import os
16+
import pathlib
1517
import sys
1618

19+
from distutils.version import LooseVersion as CheckVer
20+
21+
currdir = os.path.dirname(os.path.abspath(__file__))
22+
parent = pathlib.Path(currdir).parent
23+
path = os.path.join(parent, "odml", "info.json")
24+
25+
with open(path) as infofile:
26+
infodict = json.load(infofile)
27+
28+
version_str = infodict["VERSION"]
29+
1730
# If extensions (or modules to document with autodoc) are in another directory,
1831
# add these directories to sys.path here. If the directory is relative to the
1932
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -69,9 +82,9 @@ def __new__(meta, name, bases, clsdict):
6982
# built documents.
7083
#
7184
# The short X.Y version.
72-
version = '1.4'
85+
version = "%s.%s" % (CheckVer(version_str).version[0], CheckVer(version_str).version[1])
7386
# The full version, including alpha/beta/rc tags.
74-
release = '1.4.1'
87+
release = version_str
7588

7689
# The language for content autogenerated by Sphinx. Refer to documentation
7790
# for a list of supported languages.

0 commit comments

Comments
 (0)