[Scipy-svn] r6592 - branches/0.8.x/doc/source

scipy-svn at scipy.org scipy-svn at scipy.org
Mon Jul 5 05:03:36 EDT 2010


Author: ptvirtan
Date: 2010-07-05 04:03:36 -0500 (Mon, 05 Jul 2010)
New Revision: 6592

Modified:
   branches/0.8.x/doc/source/conf.py
Log:
0.8.x: DOC: get Scipy version number automatically

(cherry picked from r6591)

Modified: branches/0.8.x/doc/source/conf.py
===================================================================
--- branches/0.8.x/doc/source/conf.py	2010-07-05 09:01:48 UTC (rev 6591)
+++ branches/0.8.x/doc/source/conf.py	2010-07-05 09:03:36 UTC (rev 6592)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-import sys, os
+import sys, os, re
 
 # If your extensions are in another directory, add it here. If the directory
 # is relative to the documentation root, use os.path.abspath to make it
@@ -45,11 +45,20 @@
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
 #
-# The short X.Y version.
-version = '0.8.dev'
+import scipy
+# The short X.Y version (including the .devXXXX suffix if present)
+version = re.sub(r'^(\d+\.\d+)\.\d+(.*)', r'\1\2', scipy.__version__)
+if 'dev' in version:
+    # retain the .dev suffix, but clean it up
+    version = re.sub(r'(\.dev\d*).*?$', r'\1', version)
+else:
+    # strip all other suffixes
+    version = re.sub(r'^(\d+\.\d+).*?$', r'\1', version)
 # The full version, including alpha/beta/rc tags.
-release = '0.8.dev'
+release = scipy.__version__
 
+print "Scipy (VERSION %s) (RELEASE %s)" % (version, release)
+
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
 #today = ''




More information about the Scipy-svn mailing list