File: 01-get_version_from_source.patch

package info (click to toggle)
pywavelets 0.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,488 kB
  • ctags: 2,909
  • sloc: ansic: 3,616; python: 2,782; makefile: 87
file content (38 lines) | stat: -rw-r--r-- 1,368 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 5822f996b490e2a8527ca951d52240a121491ab3 Mon Sep 17 00:00:00 2001
From: Daniele Tricoli <eriol@mornie.org>
Date: Mon, 12 Oct 2015 02:20:57 +0200
Subject: 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 21d21ee..9c4ae7a 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -48,9 +48,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,)