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

package info (click to toggle)
python-cssselect 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 340 kB
  • sloc: python: 2,634; makefile: 8
file content (41 lines) | stat: -rw-r--r-- 1,202 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
From: Andrey Rakhmatullin <wrar@debian.org>
Date: Sat, 20 Apr 2024 22:44:30 +0500
Subject: Use local intersphinx files.

---
 docs/conf.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/docs/conf.py b/docs/conf.py
index ceeb2d2..27030d3 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,6 +12,7 @@
 # serve to show the default.
 
 import re
+import sys
 from pathlib import Path
 
 # If extensions (or modules to document with autodoc) are in another directory,
@@ -245,7 +246,19 @@ texinfo_documents = [
 
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
+def check_object_path(key, url, path):
+    if path and Path(path).is_file():
+        return {key: (url, path)}
+    return {}
+
+intersphinx_mapping = {}
+intersphinx_mapping.update(
+    check_object_path('python',
+                      'https://docs.python.org/3/',
+                      '/usr/share/doc/python%d.%d/html/objects.inv' % \
+                       sys.version_info[:2]
+                      )
+)
 
 
 # --- Nitpicking options ------------------------------------------------------