aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Ayoub <guillaume.ayoub@kozea.fr>2012-10-19 20:03:16 +0300
committerGuillaume Ayoub <guillaume.ayoub@kozea.fr>2012-10-19 20:03:16 +0300
commit2437fcf650540a770096371727c8d7b9f4191abd (patch)
tree70f6d58878919cce226fdaece62e2285cec1e41d
parentPrepare 0.7.0 release (diff)
downloadfabtools-2437fcf650540a770096371727c8d7b9f4191abd.tar.xz
Deduplicate the version for the doc
This regexp takes the version from setup.py and puts the right number in the breadcrumb.
-rw-r--r--docs/conf.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 840d1ab..f56fa4e 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -11,7 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import sys, os, 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
@@ -53,10 +53,14 @@ copyright = u'2012, Ronan Amicel'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-# The short X.Y version.
-version = '0.5.1'
# The full version, including alpha/beta/rc tags.
-release = '0.5.1'
+release = re.search("version='([^']+)'",
+ open(os.path.join(os.path.dirname(__file__), os.pardir,
+ 'setup.py')).read().strip()
+).group(1)
+
+# The short X.Y version.
+version = '.'.join(release.split('.')[:2])
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.