File: docs-Don-t-depend-on-git-stuff.patch

package info (click to toggle)
twisted 25.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 20,460 kB
  • sloc: python: 203,167; makefile: 200; sh: 92; javascript: 36; xml: 31
file content (73 lines) | stat: -rw-r--r-- 2,553 bytes parent folder | download | duplicates (2)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sun, 2 Jan 2022 20:25:00 +0100
Subject: docs: Don't depend on git stuff

In preparation for the build of the documentation the system tries to
detect the Git status, we don't build within a Git tree and therefore
the build will fail. Ignoring all that Git thingy and use a static link
to the upstream source.
---
 docs/conf.py | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 774cd30..6543789 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -158,33 +158,33 @@ epub_copyright = "2020, Twisted Matrix Labs"
 
 
 # -- Extension configuration ----------------------------------------------
-_git_reference = subprocess.run(
-    ["git", "rev-parse", "--abbrev-ref", "HEAD"],
-    text=True,
-    encoding="utf8",
-    capture_output=True,
-    check=True,
-).stdout
+#_git_reference = subprocess.run(
+#    ["git", "rev-parse", "--abbrev-ref", "HEAD"],
+#    text=True,
+#    encoding="utf8",
+#    capture_output=True,
+#    check=True,
+#).stdout
 
 
-print(f"== Environment dump for {_git_reference} ===")
-pprint(dict(os.environ))
-print("======")
+#print(f"== Environment dump for {_git_reference} ===")
+#pprint(dict(os.environ))
+#print("======")
 
 
 # Try to find URL fragment for the GitHub source page based on current
 # branch or tag.
 
-if _git_reference == "HEAD":
+#if _git_reference == "HEAD":
     # It looks like the branch has no name.
     # Fallback to commit ID.
-    _git_reference = subprocess.getoutput("git rev-parse HEAD")
+#    _git_reference = subprocess.getoutput("git rev-parse HEAD")
 
 if os.environ.get("READTHEDOCS", "") == "True":
     rtd_version = os.environ.get("READTHEDOCS_VERSION", "")
-    if "." in rtd_version:
+#    if "." in rtd_version:
         # It looks like we have a tag build.
-        _git_reference = rtd_version
+#        _git_reference = rtd_version
 
 _project_root = pathlib.Path(__file__).parent.parent
 _source_root = _project_root / "src"
@@ -192,7 +192,7 @@ pydoctor_args = [
     "--quiet",
     # pydoctor should not fail the sphinx build, we have another tox environment for that.
     f"--config={_project_root}/setup.cfg",
-    f"--html-viewsource-base=https://github.com/twisted/twisted/tree/{_git_reference}/src",
+    f"--html-viewsource-base=https://github.com/twisted/twisted/tree/trunk",
     f"--project-base-dir={_source_root}",
     f"--template-dir={_source_root}/twisted/python/_pydoctortemplates",
     "--html-output={outdir}/api",