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
|
From: Andrey Rakhmatullin <wrar@debian.org>
Date: Sun, 22 Mar 2026 15:24:52 +0500
Subject: Use local intersphinx files.
---
docs/conf.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index bea5286..b379503 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -10,6 +10,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
+import os
import sys
from pathlib import Path
@@ -187,12 +188,19 @@ epub_exclude_files = ["search.html"]
# -- Extension configuration -------------------------------------------------
# -- Options for intersphinx extension ---------------------------------------
-intersphinx_mapping = {
- "python": (
+def check_object_path(key, url, path):
+ if path and os.path.isfile(path):
+ return {key: (url, path)}
+ return {}
+
+intersphinx_mapping = {}
+intersphinx_mapping.update(
+ check_object_path(
+ "python",
"https://docs.python.org/3",
- None,
+ "/usr/share/doc/python%d.%d/html/objects.inv" % sys.version_info[:2],
)
-}
+)
autodoc_default_options = {
"special-members": "__init__,__call__",
|