File: 0006-use-local-documentation.patch

package info (click to toggle)
python-aiohttp 3.11.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,156 kB
  • sloc: python: 51,898; ansic: 20,843; makefile: 395; javascript: 31; sh: 3
file content (52 lines) | stat: -rw-r--r-- 2,451 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
47
48
49
50
51
52
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 18 Aug 2024 12:01:35 +0100
Subject: Use local Sphinx inventories where available

---
 docs/conf.py | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index a2df0b1..d35ae2a 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -70,20 +70,25 @@ try:
 except ImportError:
     pass
 
-
-intersphinx_mapping = {
-    "pytest": ("http://docs.pytest.org/en/latest/", None),
-    "python": ("http://docs.python.org/3", None),
-    "multidict": ("https://multidict.readthedocs.io/en/stable/", None),
-    "propcache": ("https://propcache.aio-libs.org/en/stable", None),
-    "yarl": ("https://yarl.readthedocs.io/en/stable/", None),
-    "aiosignal": ("https://aiosignal.readthedocs.io/en/stable/", None),
-    "aiohttpjinja2": ("https://aiohttp-jinja2.readthedocs.io/en/stable/", None),
-    "aiohttpremotes": ("https://aiohttp-remotes.readthedocs.io/en/stable/", None),
-    "aiohttpsession": ("https://aiohttp-session.readthedocs.io/en/stable/", None),
-    "aiohttpdemos": ("https://aiohttp-demos.readthedocs.io/en/latest/", None),
-    "aiojobs": ("https://aiojobs.readthedocs.io/en/stable/", None),
-}
+def check_object_path(key, url, path):
+    if path is not None and os.path.isfile(path):
+        return {key: (url, path)}
+    return {}
+
+intersphinx_mapping = {}
+for key, url, path in (
+    ("pytest", "http://docs.pytest.org/en/latest/", "/usr/share/doc/python-pytest-doc/html/objects.inv"),
+    ("python", "http://docs.python.org/3", "/usr/share/doc/python3/html/objects.inv"),
+    ("multidict", "https://multidict.readthedocs.io/en/stable/", None),
+    ("yarl", "https://yarl.readthedocs.io/en/stable/", "/usr/share/doc/python-yarl-doc/html/objects.inv"),
+    ("aiosignal", "https://aiosignal.readthedocs.io/en/stable/", None),
+    ("aiohttpjinja2", "https://aiohttp-jinja2.readthedocs.io/en/stable/", None),
+    ("aiohttpremotes", "https://aiohttp-remotes.readthedocs.io/en/stable/", None),
+    ("aiohttpsession", "https://aiohttp-session.readthedocs.io/en/stable/", None),
+    ("aiohttpdemos", "https://aiohttp-demos.readthedocs.io/en/latest/", None),
+    ("aiojobs", "https://aiojobs.readthedocs.io/en/stable/", None),
+):
+    intersphinx_mapping.update(check_object_path(key, url, path))
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ["_templates"]