aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Documentation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-05-16 00:30:45 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-05-21 02:45:14 +0200
commit73851f382fb5073a30dcbf0103d9ba98f3ee43e6 (patch)
tree8e06dcb7cb3af839e4411fb6aca8ea83f873cc38 /Documentation
parent94ee13c22452922f25703b7468ae11b4e40d09aa (diff)
downloadsparse-dev-73851f382fb5073a30dcbf0103d9ba98f3ee43e6.tar.gz
doc: automatically get the version
Documentation generated by sphinx reference the version of the project being documented. This version need to be specified via sphinx's config file. However, if this version number is simply added there, it's guaranteed that soon or later it will be out-of-synch with git's version tag (or the version number present in the Makefile). Fix this by trying to read the version from git or, if this fails, from the Makefile. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/conf.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 082cf61a..cfb0be7f 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -55,10 +55,10 @@ author = "sparse's development community"
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-# The short X.Y version.
-version = u'0.5.9'
# The full version, including alpha/beta/rc tags.
-release = u'0.5.9'
+release = next(open('../Makefile', 'r')).split('=')[1].rstrip()
+# The short X.Y version.
+version = release.split('-')[0]
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.