Package: drf-yasg-nonfree / 1.21.10-1

debian-hacks/Catch-up-package-version-from-environment.patch Patch series | 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
39
40
41
42
43
44
45
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Thu, 27 May 2021 17:31:58 +0200
Subject: Sphinx: Catch up package version from environment

We don't have a installed version of drf-yasg within the chroot,
inflating the package version through the environment variable
'DRF_YASG_UPSTREAM_VERSION' which is exported through debian/rules.
---
 docs/conf.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 8348735..f2250f8 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,18 +51,19 @@ author = 'Cristi V.'
 # built documents.
 
 # The full version, including alpha/beta/rc tags.
-try:
-    release = metadata.version('drf_yasg')
-except NameError:  # Python < 3.8
-    release = get_distribution('drf_yasg').version
-if 'noscm' in release:
-    raise AssertionError('Invalid package version string: %s. \n'
-                         'The documentation must be built with drf_yasg installed from a distribution package, '
-                         'which must have been built with a proper version number (i.e. from a full source checkout).'
-                         % (release,))
+#try:
+#    release = metadata.version('drf_yasg')
+#except NameError:  # Python < 3.8
+#    release = get_distribution('drf_yasg').version
+#if 'noscm' in release:
+#    raise AssertionError('Invalid package version string: %s. \n'
+#                         'The documentation must be built with drf_yasg installed from a distribution package, '
+#                         'which must have been built with a proper version number (i.e. from a full source checkout).'
+#                         % (release,))
 
 # The short X.Y.Z version.
-version = '.'.join(release.split('.')[:3])
+#version = '.'.join(release.split('.')[:3])
+version = os.environ['DRF_YASG_UPSTREAM_VERSION']
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.