Sphinx 7.3.7__py3-none-any.whl → 7.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Sphinx might be problematic. Click here for more details.
- sphinx/__init__.py +5 -6
- sphinx/_cli/__init__.py +296 -0
- sphinx/_cli/util/__init__.py +0 -0
- sphinx/_cli/util/colour.py +103 -0
- sphinx/_cli/util/errors.py +165 -0
- sphinx/application.py +78 -43
- sphinx/builders/__init__.py +59 -15
- sphinx/builders/_epub_base.py +11 -5
- sphinx/builders/changes.py +2 -2
- sphinx/builders/epub3.py +2 -2
- sphinx/builders/gettext.py +10 -10
- sphinx/builders/html/__init__.py +56 -54
- sphinx/builders/latex/__init__.py +5 -5
- sphinx/builders/latex/constants.py +5 -0
- sphinx/builders/linkcheck.py +73 -38
- sphinx/builders/texinfo.py +1 -1
- sphinx/cmd/build.py +1 -1
- sphinx/cmd/quickstart.py +11 -11
- sphinx/config.py +57 -38
- sphinx/directives/__init__.py +7 -9
- sphinx/directives/code.py +12 -15
- sphinx/directives/other.py +12 -15
- sphinx/directives/patches.py +26 -0
- sphinx/domains/__init__.py +1 -1
- sphinx/domains/c/__init__.py +5 -5
- sphinx/domains/c/_ast.py +436 -12
- sphinx/domains/c/_symbol.py +89 -134
- sphinx/domains/changeset.py +3 -4
- sphinx/domains/cpp/__init__.py +5 -6
- sphinx/domains/cpp/_ast.py +822 -25
- sphinx/domains/cpp/_symbol.py +3 -0
- sphinx/domains/javascript.py +3 -6
- sphinx/domains/math.py +3 -2
- sphinx/domains/python/__init__.py +44 -6
- sphinx/domains/python/_object.py +7 -5
- sphinx/domains/rst.py +2 -2
- sphinx/domains/std/__init__.py +95 -14
- sphinx/environment/__init__.py +35 -15
- sphinx/environment/adapters/indexentries.py +71 -24
- sphinx/environment/adapters/toctree.py +1 -1
- sphinx/environment/collectors/__init__.py +18 -4
- sphinx/environment/collectors/asset.py +4 -4
- sphinx/environment/collectors/toctree.py +27 -14
- sphinx/events.py +7 -6
- sphinx/ext/apidoc.py +377 -170
- sphinx/ext/autodoc/__init__.py +13 -13
- sphinx/ext/autodoc/directive.py +10 -13
- sphinx/ext/autodoc/mock.py +10 -7
- sphinx/ext/autodoc/preserve_defaults.py +1 -1
- sphinx/ext/autodoc/typehints.py +2 -2
- sphinx/ext/autosummary/__init__.py +15 -9
- sphinx/ext/autosummary/generate.py +270 -154
- sphinx/ext/coverage.py +108 -18
- sphinx/ext/duration.py +10 -3
- sphinx/ext/extlinks.py +3 -2
- sphinx/ext/graphviz.py +3 -3
- sphinx/ext/ifconfig.py +1 -2
- sphinx/ext/imgconverter.py +1 -0
- sphinx/ext/imgmath.py +7 -6
- sphinx/ext/inheritance_diagram.py +3 -3
- sphinx/ext/intersphinx/__init__.py +81 -0
- sphinx/ext/intersphinx/__main__.py +10 -0
- sphinx/ext/intersphinx/_cli.py +44 -0
- sphinx/ext/intersphinx/_load.py +253 -0
- sphinx/ext/{intersphinx.py → intersphinx/_resolve.py} +17 -368
- sphinx/ext/intersphinx/_shared.py +53 -0
- sphinx/ext/mathjax.py +1 -1
- sphinx/ext/todo.py +2 -2
- sphinx/io.py +2 -6
- sphinx/locale/__init__.py +1 -5
- sphinx/locale/ar/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ar/LC_MESSAGES/sphinx.po +678 -471
- sphinx/locale/bg/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bg/LC_MESSAGES/sphinx.po +684 -476
- sphinx/locale/bn/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bn/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/ca/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ca/LC_MESSAGES/sphinx.po +681 -474
- sphinx/locale/cak/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cak/LC_MESSAGES/sphinx.po +678 -471
- sphinx/locale/cs/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cs/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/cy/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cy/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/da/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/da/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/de/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de/LC_MESSAGES/sphinx.po +679 -472
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +678 -471
- sphinx/locale/el/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/el/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/eo/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eo/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/es/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/et/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/et/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/eu/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eu/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/fa/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fa/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/fi/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fi/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/fr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr/LC_MESSAGES/sphinx.po +725 -518
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/gl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/gl/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/he/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/he/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/hi/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/hr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hr/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/hu/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hu/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/id/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/id/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/is/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/is/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/it/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/it/LC_MESSAGES/sphinx.po +708 -500
- sphinx/locale/ja/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ja/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ka/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ka/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/ko/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ko/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/lt/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lt/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/lv/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lv/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/mk/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/mk/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ne/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ne/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/nl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nl/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/pl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pl/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/pt/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +705 -498
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ro/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ro/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ru/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ru/LC_MESSAGES/sphinx.po +890 -680
- sphinx/locale/si/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/si/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/sk/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sk/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/sl/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sl/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/sphinx.pot +702 -494
- sphinx/locale/sq/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sq/LC_MESSAGES/sphinx.po +704 -497
- sphinx/locale/sr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/sr@latin/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr_RS/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sv/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sv/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ta/LC_MESSAGES/sphinx.po +1016 -808
- sphinx/locale/te/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/te/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/tr/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/tr/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/ur/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ur/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/vi/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/vi/LC_MESSAGES/sphinx.po +701 -494
- sphinx/locale/yue/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/yue/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +704 -496
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +700 -493
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +729 -522
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.js +1 -1
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +700 -493
- sphinx/roles.py +1 -1
- sphinx/search/__init__.py +17 -9
- sphinx/templates/quickstart/{root_doc.rst_t → root_doc.rst.jinja} +7 -10
- sphinx/testing/fixtures.py +22 -20
- sphinx/testing/path.py +6 -2
- sphinx/testing/util.py +8 -13
- sphinx/texinputs/sphinx.sty +449 -332
- sphinx/texinputs/sphinxlatexadmonitions.sty +209 -66
- sphinx/texinputs/sphinxlatexliterals.sty +9 -16
- sphinx/texinputs/sphinxlatexstyletext.sty +4 -38
- sphinx/texinputs/sphinxlatextables.sty +6 -14
- sphinx/texinputs/sphinxpackageboxes.sty +15 -42
- sphinx/texinputs/sphinxpackagefootnote.sty +4 -3
- sphinx/themes/agogo/layout.html +3 -3
- sphinx/themes/basic/genindex-single.html +2 -1
- sphinx/themes/basic/layout.html +3 -6
- sphinx/themes/basic/static/searchtools.js +4 -3
- sphinx/themes/haiku/layout.html +4 -4
- sphinx/themes/pyramid/layout.html +1 -1
- sphinx/themes/scrolls/layout.html +2 -2
- sphinx/theming.py +3 -3
- sphinx/transforms/__init__.py +34 -20
- sphinx/transforms/i18n.py +8 -7
- sphinx/transforms/post_transforms/__init__.py +1 -1
- sphinx/transforms/post_transforms/images.py +7 -10
- sphinx/util/_pathlib.py +2 -2
- sphinx/util/cfamily.py +52 -30
- sphinx/util/console.py +1 -1
- sphinx/util/display.py +16 -11
- sphinx/util/docutils.py +88 -40
- sphinx/util/fileutil.py +15 -3
- sphinx/util/images.py +1 -0
- sphinx/util/inspect.py +66 -22
- sphinx/util/inventory.py +15 -0
- sphinx/util/logging.py +14 -21
- sphinx/util/math.py +3 -1
- sphinx/util/nodes.py +9 -12
- sphinx/util/osutil.py +5 -5
- sphinx/util/parsing.py +93 -0
- sphinx/util/tags.py +71 -47
- sphinx/util/typing.py +265 -143
- sphinx/versioning.py +17 -17
- sphinx/writers/html5.py +26 -19
- sphinx/writers/latex.py +60 -30
- sphinx/writers/manpage.py +4 -3
- sphinx/writers/texinfo.py +19 -14
- {sphinx-7.3.7.dist-info → sphinx-7.4.1.dist-info}/METADATA +21 -20
- sphinx-7.4.1.dist-info/RECORD +591 -0
- sphinx-7.3.7.dist-info/RECORD +0 -581
- /sphinx/templates/apidoc/{module.rst_t → module.rst.jinja} +0 -0
- /sphinx/templates/apidoc/{package.rst_t → package.rst.jinja} +0 -0
- /sphinx/templates/apidoc/{toc.rst_t → toc.rst.jinja} +0 -0
- /sphinx/templates/epub3/{content.opf_t → content.opf.jinja} +0 -0
- /sphinx/templates/epub3/{nav.xhtml_t → nav.xhtml.jinja} +0 -0
- /sphinx/templates/epub3/{toc.ncx_t → toc.ncx.jinja} +0 -0
- /sphinx/templates/gettext/{message.pot_t → message.pot.jinja} +0 -0
- /sphinx/templates/imgmath/{preview.tex_t → preview.tex.jinja} +0 -0
- /sphinx/templates/imgmath/{template.tex_t → template.tex.jinja} +0 -0
- /sphinx/templates/latex/{latex.tex_t → latex.tex.jinja} +0 -0
- /sphinx/templates/latex/{longtable.tex_t → longtable.tex.jinja} +0 -0
- /sphinx/templates/latex/{sphinxmessages.sty_t → sphinxmessages.sty.jinja} +0 -0
- /sphinx/templates/latex/{tabular.tex_t → tabular.tex.jinja} +0 -0
- /sphinx/templates/latex/{tabulary.tex_t → tabulary.tex.jinja} +0 -0
- /sphinx/templates/quickstart/{Makefile_t → Makefile.jinja} +0 -0
- /sphinx/templates/quickstart/{Makefile.new_t → Makefile.new.jinja} +0 -0
- /sphinx/templates/quickstart/{conf.py_t → conf.py.jinja} +0 -0
- /sphinx/templates/quickstart/{make.bat_t → make.bat.jinja} +0 -0
- /sphinx/templates/quickstart/{make.bat.new_t → make.bat.new.jinja} +0 -0
- /sphinx/texinputs/{Makefile_t → Makefile.jinja} +0 -0
- /sphinx/texinputs/{latexmkjarc_t → latexmkjarc.jinja} +0 -0
- /sphinx/texinputs/{latexmkrc_t → latexmkrc.jinja} +0 -0
- /sphinx/texinputs/{make.bat_t → make.bat.jinja} +0 -0
- /sphinx/texinputs_win/{Makefile_t → Makefile.jinja} +0 -0
- /sphinx/themes/agogo/static/{agogo.css_t → agogo.css.jinja} +0 -0
- /sphinx/themes/basic/static/{basic.css_t → basic.css.jinja} +0 -0
- /sphinx/themes/basic/static/{documentation_options.js_t → documentation_options.js.jinja} +0 -0
- /sphinx/themes/basic/static/{language_data.js_t → language_data.js.jinja} +0 -0
- /sphinx/themes/bizstyle/static/{bizstyle.css_t → bizstyle.css.jinja} +0 -0
- /sphinx/themes/bizstyle/static/{bizstyle.js_t → bizstyle.js.jinja} +0 -0
- /sphinx/themes/classic/static/{classic.css_t → classic.css.jinja} +0 -0
- /sphinx/themes/classic/static/{sidebar.js_t → sidebar.js.jinja} +0 -0
- /sphinx/themes/epub/static/{epub.css_t → epub.css.jinja} +0 -0
- /sphinx/themes/haiku/static/{haiku.css_t → haiku.css.jinja} +0 -0
- /sphinx/themes/nature/static/{nature.css_t → nature.css.jinja} +0 -0
- /sphinx/themes/nonav/static/{nonav.css_t → nonav.css.jinja} +0 -0
- /sphinx/themes/pyramid/static/{epub.css_t → epub.css.jinja} +0 -0
- /sphinx/themes/pyramid/static/{pyramid.css_t → pyramid.css.jinja} +0 -0
- /sphinx/themes/scrolls/static/{scrolls.css_t → scrolls.css.jinja} +0 -0
- /sphinx/themes/sphinxdoc/static/{sphinxdoc.css_t → sphinxdoc.css.jinja} +0 -0
- /sphinx/themes/traditional/static/{traditional.css_t → traditional.css.jinja} +0 -0
- {sphinx-7.3.7.dist-info → sphinx-7.4.1.dist-info}/LICENSE.rst +0 -0
- {sphinx-7.3.7.dist-info → sphinx-7.4.1.dist-info}/WHEEL +0 -0
- {sphinx-7.3.7.dist-info → sphinx-7.4.1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"""This module contains the code for loading intersphinx inventories."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import concurrent.futures
|
|
6
|
+
import functools
|
|
7
|
+
import posixpath
|
|
8
|
+
import time
|
|
9
|
+
from os import path
|
|
10
|
+
from typing import TYPE_CHECKING
|
|
11
|
+
from urllib.parse import urlsplit, urlunsplit
|
|
12
|
+
|
|
13
|
+
from sphinx.builders.html import INVENTORY_FILENAME
|
|
14
|
+
from sphinx.ext.intersphinx._shared import LOGGER, InventoryAdapter
|
|
15
|
+
from sphinx.locale import __
|
|
16
|
+
from sphinx.util import requests
|
|
17
|
+
from sphinx.util.inventory import InventoryFile
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from typing import IO
|
|
21
|
+
|
|
22
|
+
from sphinx.application import Sphinx
|
|
23
|
+
from sphinx.config import Config
|
|
24
|
+
from sphinx.ext.intersphinx._shared import InventoryCacheEntry
|
|
25
|
+
from sphinx.util.typing import Inventory
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def normalize_intersphinx_mapping(app: Sphinx, config: Config) -> None:
|
|
29
|
+
for key, value in config.intersphinx_mapping.copy().items():
|
|
30
|
+
try:
|
|
31
|
+
if isinstance(value, (list, tuple)):
|
|
32
|
+
# new format
|
|
33
|
+
name, (uri, inv) = key, value
|
|
34
|
+
if not isinstance(name, str):
|
|
35
|
+
LOGGER.warning(__('intersphinx identifier %r is not string. Ignored'),
|
|
36
|
+
name)
|
|
37
|
+
config.intersphinx_mapping.pop(key)
|
|
38
|
+
continue
|
|
39
|
+
else:
|
|
40
|
+
# old format, no name
|
|
41
|
+
# xref RemovedInSphinx80Warning
|
|
42
|
+
name, uri, inv = None, key, value
|
|
43
|
+
msg = (
|
|
44
|
+
"The pre-Sphinx 1.0 'intersphinx_mapping' format is "
|
|
45
|
+
'deprecated and will be removed in Sphinx 8. Update to the '
|
|
46
|
+
'current format as described in the documentation. '
|
|
47
|
+
f"Hint: `intersphinx_mapping = {{'<name>': {(uri, inv)!r}}}`."
|
|
48
|
+
'https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_mapping' # NoQA: E501
|
|
49
|
+
)
|
|
50
|
+
LOGGER.warning(msg)
|
|
51
|
+
|
|
52
|
+
if not isinstance(inv, tuple):
|
|
53
|
+
config.intersphinx_mapping[key] = (name, (uri, (inv,)))
|
|
54
|
+
else:
|
|
55
|
+
config.intersphinx_mapping[key] = (name, (uri, inv))
|
|
56
|
+
except Exception as exc:
|
|
57
|
+
LOGGER.warning(__('Failed to read intersphinx_mapping[%s], ignored: %r'), key, exc)
|
|
58
|
+
config.intersphinx_mapping.pop(key)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def load_mappings(app: Sphinx) -> None:
|
|
62
|
+
"""Load all intersphinx mappings into the environment."""
|
|
63
|
+
now = int(time.time())
|
|
64
|
+
inventories = InventoryAdapter(app.builder.env)
|
|
65
|
+
intersphinx_cache: dict[str, InventoryCacheEntry] = inventories.cache
|
|
66
|
+
|
|
67
|
+
with concurrent.futures.ThreadPoolExecutor() as pool:
|
|
68
|
+
futures = []
|
|
69
|
+
name: str | None
|
|
70
|
+
uri: str
|
|
71
|
+
invs: tuple[str | None, ...]
|
|
72
|
+
for name, (uri, invs) in app.config.intersphinx_mapping.values():
|
|
73
|
+
futures.append(pool.submit(
|
|
74
|
+
fetch_inventory_group, name, uri, invs, intersphinx_cache, app, now,
|
|
75
|
+
))
|
|
76
|
+
updated = [f.result() for f in concurrent.futures.as_completed(futures)]
|
|
77
|
+
|
|
78
|
+
if any(updated):
|
|
79
|
+
inventories.clear()
|
|
80
|
+
|
|
81
|
+
# Duplicate values in different inventories will shadow each
|
|
82
|
+
# other; which one will override which can vary between builds
|
|
83
|
+
# since they are specified using an unordered dict. To make
|
|
84
|
+
# it more consistent, we sort the named inventories and then
|
|
85
|
+
# add the unnamed inventories last. This means that the
|
|
86
|
+
# unnamed inventories will shadow the named ones but the named
|
|
87
|
+
# ones can still be accessed when the name is specified.
|
|
88
|
+
named_vals = []
|
|
89
|
+
unnamed_vals = []
|
|
90
|
+
for name, _expiry, invdata in intersphinx_cache.values():
|
|
91
|
+
if name:
|
|
92
|
+
named_vals.append((name, invdata))
|
|
93
|
+
else:
|
|
94
|
+
unnamed_vals.append((name, invdata))
|
|
95
|
+
for name, invdata in sorted(named_vals) + unnamed_vals:
|
|
96
|
+
if name:
|
|
97
|
+
inventories.named_inventory[name] = invdata
|
|
98
|
+
for type, objects in invdata.items():
|
|
99
|
+
inventories.main_inventory.setdefault(type, {}).update(objects)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def fetch_inventory_group(
|
|
103
|
+
name: str | None,
|
|
104
|
+
uri: str,
|
|
105
|
+
invs: tuple[str | None, ...],
|
|
106
|
+
cache: dict[str, InventoryCacheEntry],
|
|
107
|
+
app: Sphinx,
|
|
108
|
+
now: int,
|
|
109
|
+
) -> bool:
|
|
110
|
+
cache_time = now - app.config.intersphinx_cache_limit * 86400
|
|
111
|
+
failures = []
|
|
112
|
+
try:
|
|
113
|
+
for inv in invs:
|
|
114
|
+
if not inv:
|
|
115
|
+
inv = posixpath.join(uri, INVENTORY_FILENAME)
|
|
116
|
+
# decide whether the inventory must be read: always read local
|
|
117
|
+
# files; remote ones only if the cache time is expired
|
|
118
|
+
if '://' not in inv or uri not in cache or cache[uri][1] < cache_time:
|
|
119
|
+
safe_inv_url = _get_safe_url(inv)
|
|
120
|
+
inv_descriptor = name or 'main_inventory'
|
|
121
|
+
LOGGER.info(__("loading intersphinx inventory '%s' from %s..."),
|
|
122
|
+
inv_descriptor, safe_inv_url)
|
|
123
|
+
try:
|
|
124
|
+
invdata = fetch_inventory(app, uri, inv)
|
|
125
|
+
except Exception as err:
|
|
126
|
+
failures.append(err.args)
|
|
127
|
+
continue
|
|
128
|
+
if invdata:
|
|
129
|
+
cache[uri] = name, now, invdata
|
|
130
|
+
return True
|
|
131
|
+
return False
|
|
132
|
+
finally:
|
|
133
|
+
if failures == []:
|
|
134
|
+
pass
|
|
135
|
+
elif len(failures) < len(invs):
|
|
136
|
+
LOGGER.info(__('encountered some issues with some of the inventories,'
|
|
137
|
+
' but they had working alternatives:'))
|
|
138
|
+
for fail in failures:
|
|
139
|
+
LOGGER.info(*fail)
|
|
140
|
+
else:
|
|
141
|
+
issues = '\n'.join(f[0] % f[1:] for f in failures)
|
|
142
|
+
LOGGER.warning(__('failed to reach any of the inventories '
|
|
143
|
+
'with the following issues:') + '\n' + issues)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def fetch_inventory(app: Sphinx, uri: str, inv: str) -> Inventory:
|
|
147
|
+
"""Fetch, parse and return an intersphinx inventory file."""
|
|
148
|
+
# both *uri* (base URI of the links to generate) and *inv* (actual
|
|
149
|
+
# location of the inventory file) can be local or remote URIs
|
|
150
|
+
if '://' in uri:
|
|
151
|
+
# case: inv URI points to remote resource; strip any existing auth
|
|
152
|
+
uri = _strip_basic_auth(uri)
|
|
153
|
+
try:
|
|
154
|
+
if '://' in inv:
|
|
155
|
+
f = _read_from_url(inv, config=app.config)
|
|
156
|
+
else:
|
|
157
|
+
f = open(path.join(app.srcdir, inv), 'rb') # NoQA: SIM115
|
|
158
|
+
except Exception as err:
|
|
159
|
+
err.args = ('intersphinx inventory %r not fetchable due to %s: %s',
|
|
160
|
+
inv, err.__class__, str(err))
|
|
161
|
+
raise
|
|
162
|
+
try:
|
|
163
|
+
if hasattr(f, 'url'):
|
|
164
|
+
newinv = f.url
|
|
165
|
+
if inv != newinv:
|
|
166
|
+
LOGGER.info(__('intersphinx inventory has moved: %s -> %s'), inv, newinv)
|
|
167
|
+
|
|
168
|
+
if uri in (inv, path.dirname(inv), path.dirname(inv) + '/'):
|
|
169
|
+
uri = path.dirname(newinv)
|
|
170
|
+
with f:
|
|
171
|
+
try:
|
|
172
|
+
invdata = InventoryFile.load(f, uri, posixpath.join)
|
|
173
|
+
except ValueError as exc:
|
|
174
|
+
raise ValueError('unknown or unsupported inventory version: %r' % exc) from exc
|
|
175
|
+
except Exception as err:
|
|
176
|
+
err.args = ('intersphinx inventory %r not readable due to %s: %s',
|
|
177
|
+
inv, err.__class__.__name__, str(err))
|
|
178
|
+
raise
|
|
179
|
+
else:
|
|
180
|
+
return invdata
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def _get_safe_url(url: str) -> str:
|
|
184
|
+
"""Gets version of *url* with basic auth passwords obscured. This function
|
|
185
|
+
returns results suitable for printing and logging.
|
|
186
|
+
|
|
187
|
+
E.g.: https://user:12345@example.com => https://user@example.com
|
|
188
|
+
|
|
189
|
+
:param url: a url
|
|
190
|
+
:type url: ``str``
|
|
191
|
+
|
|
192
|
+
:return: *url* with password removed
|
|
193
|
+
:rtype: ``str``
|
|
194
|
+
"""
|
|
195
|
+
parts = urlsplit(url)
|
|
196
|
+
if parts.username is None:
|
|
197
|
+
return url
|
|
198
|
+
else:
|
|
199
|
+
frags = list(parts)
|
|
200
|
+
if parts.port:
|
|
201
|
+
frags[1] = f'{parts.username}@{parts.hostname}:{parts.port}'
|
|
202
|
+
else:
|
|
203
|
+
frags[1] = f'{parts.username}@{parts.hostname}'
|
|
204
|
+
|
|
205
|
+
return urlunsplit(frags)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _strip_basic_auth(url: str) -> str:
|
|
209
|
+
"""Returns *url* with basic auth credentials removed. Also returns the
|
|
210
|
+
basic auth username and password if they're present in *url*.
|
|
211
|
+
|
|
212
|
+
E.g.: https://user:pass@example.com => https://example.com
|
|
213
|
+
|
|
214
|
+
*url* need not include basic auth credentials.
|
|
215
|
+
|
|
216
|
+
:param url: url which may or may not contain basic auth credentials
|
|
217
|
+
:type url: ``str``
|
|
218
|
+
|
|
219
|
+
:return: *url* with any basic auth creds removed
|
|
220
|
+
:rtype: ``str``
|
|
221
|
+
"""
|
|
222
|
+
frags = list(urlsplit(url))
|
|
223
|
+
# swap out 'user[:pass]@hostname' for 'hostname'
|
|
224
|
+
if '@' in frags[1]:
|
|
225
|
+
frags[1] = frags[1].split('@')[1]
|
|
226
|
+
return urlunsplit(frags)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def _read_from_url(url: str, *, config: Config) -> IO:
|
|
230
|
+
"""Reads data from *url* with an HTTP *GET*.
|
|
231
|
+
|
|
232
|
+
This function supports fetching from resources which use basic HTTP auth as
|
|
233
|
+
laid out by RFC1738 § 3.1. See § 5 for grammar definitions for URLs.
|
|
234
|
+
|
|
235
|
+
.. seealso:
|
|
236
|
+
|
|
237
|
+
https://www.ietf.org/rfc/rfc1738.txt
|
|
238
|
+
|
|
239
|
+
:param url: URL of an HTTP resource
|
|
240
|
+
:type url: ``str``
|
|
241
|
+
|
|
242
|
+
:return: data read from resource described by *url*
|
|
243
|
+
:rtype: ``file``-like object
|
|
244
|
+
"""
|
|
245
|
+
r = requests.get(url, stream=True, timeout=config.intersphinx_timeout,
|
|
246
|
+
_user_agent=config.user_agent,
|
|
247
|
+
_tls_info=(config.tls_verify, config.tls_cacerts))
|
|
248
|
+
r.raise_for_status()
|
|
249
|
+
r.raw.url = r.url
|
|
250
|
+
# decode content-body based on the header.
|
|
251
|
+
# ref: https://github.com/psf/requests/issues/2155
|
|
252
|
+
r.raw.read = functools.partial(r.raw.read, decode_content=True)
|
|
253
|
+
return r.raw
|