File: Sphinx-Catch-up-package-version-from-environment.patch

package info (click to toggle)
drf-yasg-nonfree 1.21.11-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 15,800 kB
  • sloc: javascript: 6,247; python: 6,131; makefile: 31; sh: 13
file content (46 lines) | stat: -rw-r--r-- 1,729 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
39
40
41
42
43
44
45
46
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sat, 8 Nov 2025 11:14:42 +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.

Forwarded: not-needed
---
 docs/conf.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index e763403..292e657 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,17 +51,18 @@ author = "Cristi V."
 # built documents.
 
 # The full version, including alpha/beta/rc tags.
-release = metadata.version("drf_yasg")
-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,)
-    )
-
+#release = metadata.version("drf_yasg")
+#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.