File: 0001-Use-local-intersphinx-files.patch

package info (click to toggle)
python-web-poet 0.23.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 940 kB
  • sloc: python: 6,113; makefile: 19
file content (117 lines) | stat: -rw-r--r-- 3,126 bytes parent folder | download | duplicates (3)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
From: Andrey Rakhmatullin <wrar@debian.org>
Date: Mon, 23 Mar 2026 22:25:04 +0500
Subject: Use local intersphinx files.

---
 docs/conf.py | 90 ++++++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 60 insertions(+), 30 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index 4393290..b22bc27 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -4,6 +4,7 @@
 # full list see the documentation:
 # http://www.sphinx-doc.org/en/master/config
 
+import os
 import sys
 from pathlib import Path
 
@@ -183,37 +184,66 @@ autodoc_member_order = "bysource"
 # -- Options for intersphinx extension ---------------------------------------
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {
-    "attrs": (
+def check_object_path(key, url, path):
+    if os.path.isfile(path):
+        return {key: (url, path)}
+    return {}
+
+
+intersphinx_mapping = {}
+intersphinx_mapping.update(
+    check_object_path(
+        "attrs",
         "https://www.attrs.org/en/stable/",
-        None,
-    ),
-    "form2request": (
-        "https://form2request.readthedocs.io/en/latest/",
-        None,
-    ),
-    "python": (
+        "/usr/share/doc/python-attr-doc/html/objects.inv",
+    )
+)
+# intersphinx_mapping.update(
+#     check_object_path(
+#         "form2request",
+#         "https://form2request.readthedocs.io/en/latest/",
+#         "/usr/share/doc/python-form2request-doc/html/objects.inv",
+#     )
+# )
+intersphinx_mapping.update(
+    check_object_path(
+        "python",
         "https://docs.python.org/3",
-        None,
-    ),
-    "scrapy": (
-        "https://docs.scrapy.org/en/latest",
-        None,
-    ),
-    "url-matcher": (
+        "/usr/share/doc/python%d.%d/html/objects.inv" % sys.version_info[:2],
+    )
+)
+intersphinx_mapping.update(
+    check_object_path(
+        "scrapy",
+        "https://docs.scrapy.org/en/latest/",
+        "/usr/share/doc/python-scrapy-doc/html/objects.inv",
+    )
+)
+intersphinx_mapping.update(
+    check_object_path(
+        "url-matcher",
         "https://url-matcher.readthedocs.io/en/latest/",
-        None,
-    ),
-    "parsel": (
+        "/usr/share/doc/python-url-matcher-doc/html/objects.inv",
+    )
+)
+intersphinx_mapping.update(
+    check_object_path(
+        "parsel",
         "https://parsel.readthedocs.io/en/latest/",
-        None,
-    ),
-    "multidict": (
-        "https://multidict.aio-libs.org/en/latest/",
-        None,
-    ),
-    "scrapy-poet": (
-        "https://scrapy-poet.readthedocs.io/en/latest/",
-        None,
-    ),
-}
+        "/usr/share/doc/python-parsel-doc/html/objects.inv",
+    )
+)
+# intersphinx_mapping.update(
+#     check_object_path(
+#         "multidict",
+#         "https://multidict.aio-libs.org/en/latest/",
+#         "/usr/share/doc/python-multidict-doc/html/objects.inv",
+#     )
+# )
+# intersphinx_mapping.update(
+#     check_object_path(
+#         "scrapy-poet",
+#         "https://scrapy-poet.readthedocs.io/en/latest/",
+#         "/usr/share/doc/python-scrapy-poet-doc/html/objects.inv",
+#     )
+# )