[Python-modules-commits] [pywavelets] 04/07: Grab version from the source code instead of importing pywt to

Daniele Tricoli eriol-guest at moszumanska.debian.org
Tue Dec 13 00:21:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

eriol-guest pushed a commit to branch master
in repository pywavelets.

commit 6ac11d83ef75240348f63d0d150dd4a834b16f1a
Author: Daniele Tricoli <eriol at mornie.org>
Date:   Mon Oct 12 02:20:57 2015 +0200

    Grab version from the source code instead of importing pywt to
    
     build documentation at package build time.
    Forwarded: not-needed
    Last-Update: 2015-09-13
    
    Patch-Name: 01-get_version_from_source.patch
---
 doc/source/conf.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/source/conf.py b/doc/source/conf.py
index ed49133..7544027 100755
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -49,9 +49,16 @@ copyright = jinja2.filters.do_mark_safe('2006-%s, <a href="https://groups.google
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
-import pywt
-version = re.sub(r'\.dev0+.*$', r'.dev', pywt.__version__)
-release = pywt.__version__
+
+# On Debian we want to build docs at package build time, when pywt is not
+# installed.
+import os
+base_path = os.path.dirname(__file__)
+fp = open(os.path.abspath(os.path.join(base_path, '..', '..', 'pywt', 'version.py')))
+VERSION = re.compile(r".*full_version = '(.*?)'",
+                     re.S).match(fp.read()).group(1)
+version = re.sub(r'\.dev0+.*$', r'.dev', VERSION)
+release = VERSION
 
 print "PyWavelets (VERSION %s)" % (version,)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pywavelets.git



More information about the Python-modules-commits mailing list