Sphinx 7.4.6__py3-none-any.whl → 8.0.0rc1__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 +2 -2
- sphinx/_cli/__init__.py +4 -4
- sphinx/application.py +7 -7
- sphinx/builders/__init__.py +2 -3
- sphinx/builders/_epub_base.py +33 -12
- sphinx/builders/changes.py +13 -5
- sphinx/builders/epub3.py +6 -2
- sphinx/builders/html/__init__.py +90 -59
- sphinx/builders/latex/__init__.py +38 -12
- sphinx/builders/latex/transforms.py +1 -1
- sphinx/builders/linkcheck.py +8 -49
- sphinx/builders/texinfo.py +12 -6
- sphinx/builders/text.py +7 -3
- sphinx/builders/xml.py +7 -3
- sphinx/cmd/quickstart.py +10 -20
- sphinx/config.py +12 -12
- sphinx/deprecation.py +8 -8
- sphinx/directives/__init__.py +14 -9
- sphinx/directives/other.py +2 -3
- sphinx/directives/patches.py +2 -2
- sphinx/domains/__init__.py +4 -2
- sphinx/domains/c/__init__.py +2 -2
- sphinx/domains/c/_ast.py +3 -2
- sphinx/domains/c/_parser.py +4 -3
- sphinx/domains/cpp/__init__.py +2 -2
- sphinx/domains/cpp/_ast.py +1 -2
- sphinx/domains/cpp/_parser.py +2 -2
- sphinx/domains/cpp/_symbol.py +2 -2
- sphinx/domains/javascript.py +1 -1
- sphinx/domains/math.py +1 -1
- sphinx/domains/python/__init__.py +1 -1
- sphinx/domains/python/_annotations.py +23 -1
- sphinx/domains/python/_object.py +0 -1
- sphinx/domains/std/__init__.py +7 -8
- sphinx/environment/__init__.py +14 -32
- sphinx/environment/adapters/indexentries.py +4 -6
- sphinx/environment/adapters/toctree.py +4 -4
- sphinx/environment/collectors/title.py +1 -1
- sphinx/environment/collectors/toctree.py +1 -1
- sphinx/events.py +3 -1
- sphinx/ext/autodoc/__init__.py +25 -67
- sphinx/ext/autodoc/directive.py +7 -5
- sphinx/ext/autodoc/importer.py +2 -1
- sphinx/ext/autodoc/preserve_defaults.py +2 -2
- sphinx/ext/autosummary/__init__.py +15 -7
- sphinx/ext/autosummary/generate.py +5 -4
- sphinx/ext/doctest.py +5 -5
- sphinx/ext/graphviz.py +1 -1
- sphinx/ext/imgmath.py +1 -1
- sphinx/ext/inheritance_diagram.py +1 -1
- sphinx/ext/intersphinx/__init__.py +25 -5
- sphinx/ext/intersphinx/_cli.py +7 -6
- sphinx/ext/intersphinx/_load.py +240 -115
- sphinx/ext/intersphinx/_resolve.py +12 -11
- sphinx/ext/intersphinx/_shared.py +102 -9
- sphinx/ext/mathjax.py +1 -1
- sphinx/ext/napoleon/docstring.py +2 -2
- sphinx/ext/todo.py +2 -2
- sphinx/ext/viewcode.py +2 -1
- sphinx/highlighting.py +3 -3
- sphinx/io.py +2 -2
- sphinx/jinja2glue.py +13 -6
- sphinx/locale/__init__.py +4 -3
- sphinx/locale/ta/LC_MESSAGES/sphinx.js +54 -54
- sphinx/locale/ta/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ta/LC_MESSAGES/sphinx.po +1578 -1843
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +496 -704
- sphinx/project.py +23 -19
- sphinx/pycode/ast.py +2 -2
- sphinx/pycode/parser.py +2 -2
- sphinx/pygments_styles.py +3 -3
- sphinx/registry.py +3 -8
- sphinx/search/__init__.py +1 -1
- sphinx/testing/path.py +2 -1
- sphinx/testing/util.py +1 -1
- sphinx/texinputs/Makefile.jinja +2 -1
- sphinx/texinputs_win/Makefile.jinja +2 -1
- sphinx/theming.py +3 -12
- sphinx/transforms/__init__.py +5 -5
- sphinx/transforms/references.py +1 -1
- sphinx/util/__init__.py +11 -35
- sphinx/util/_timestamps.py +12 -0
- sphinx/util/cfamily.py +5 -5
- sphinx/util/console.py +4 -3
- sphinx/util/display.py +3 -3
- sphinx/util/docfields.py +1 -1
- sphinx/util/docutils.py +44 -10
- sphinx/util/fileutil.py +41 -9
- sphinx/util/i18n.py +9 -4
- sphinx/util/images.py +3 -2
- sphinx/util/inspect.py +29 -44
- sphinx/util/inventory.py +2 -2
- sphinx/util/matching.py +2 -2
- sphinx/util/math.py +1 -1
- sphinx/util/nodes.py +8 -8
- sphinx/util/osutil.py +46 -23
- sphinx/util/parallel.py +2 -2
- sphinx/util/requests.py +1 -1
- sphinx/util/template.py +3 -3
- sphinx/util/typing.py +67 -70
- sphinx/writers/html.py +1 -1
- sphinx/writers/html5.py +1 -1
- sphinx/writers/latex.py +4 -4
- sphinx/writers/manpage.py +2 -2
- sphinx/writers/texinfo.py +5 -5
- sphinx/writers/text.py +4 -4
- sphinx/writers/xml.py +2 -2
- {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/METADATA +10 -9
- {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/RECORD +112 -114
- sphinx/templates/quickstart/Makefile.jinja +0 -98
- sphinx/templates/quickstart/make.bat.jinja +0 -110
- sphinx/util/_pathlib.py +0 -120
- {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/LICENSE.rst +0 -0
- {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/WHEEL +0 -0
- {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/entry_points.txt +0 -0
sphinx/util/_pathlib.py
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"""What follows is awful and will be gone in Sphinx 8"""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import sys
|
|
6
|
-
import warnings
|
|
7
|
-
from pathlib import Path, PosixPath, PurePath, WindowsPath
|
|
8
|
-
from typing import Any
|
|
9
|
-
|
|
10
|
-
from sphinx.deprecation import RemovedInSphinx80Warning
|
|
11
|
-
|
|
12
|
-
_STR_METHODS = frozenset(str.__dict__)
|
|
13
|
-
_PATH_NAME = Path().__class__.__name__
|
|
14
|
-
|
|
15
|
-
_MSG = (
|
|
16
|
-
'Sphinx 8 will drop support for representing paths as strings. '
|
|
17
|
-
'Use "pathlib.Path" or "os.fspath" instead.'
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
# https://docs.python.org/3/library/stdtypes.html#typesseq-common
|
|
21
|
-
# https://docs.python.org/3/library/stdtypes.html#string-methods
|
|
22
|
-
|
|
23
|
-
if sys.platform == 'win32':
|
|
24
|
-
class _StrPath(WindowsPath):
|
|
25
|
-
def replace( # type: ignore[override]
|
|
26
|
-
self, old: str, new: str, count: int = -1, /,
|
|
27
|
-
) -> str:
|
|
28
|
-
# replace exists in both Path and str;
|
|
29
|
-
# in Path it makes filesystem changes, so we use the safer str version
|
|
30
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
31
|
-
return self.__str__().replace(old, new, count) # NoQA: PLC2801
|
|
32
|
-
|
|
33
|
-
def __getattr__(self, item: str) -> Any:
|
|
34
|
-
if item in _STR_METHODS:
|
|
35
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
36
|
-
return getattr(self.__str__(), item)
|
|
37
|
-
msg = f'{_PATH_NAME!r} has no attribute {item!r}'
|
|
38
|
-
raise AttributeError(msg)
|
|
39
|
-
|
|
40
|
-
def __add__(self, other: str) -> str:
|
|
41
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
42
|
-
return self.__str__() + other
|
|
43
|
-
|
|
44
|
-
def __bool__(self) -> bool:
|
|
45
|
-
if not self.__str__():
|
|
46
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
47
|
-
return False
|
|
48
|
-
return True
|
|
49
|
-
|
|
50
|
-
def __contains__(self, item: str) -> bool:
|
|
51
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
52
|
-
return item in self.__str__()
|
|
53
|
-
|
|
54
|
-
def __eq__(self, other: object) -> bool:
|
|
55
|
-
if isinstance(other, PurePath):
|
|
56
|
-
return super().__eq__(other)
|
|
57
|
-
if isinstance(other, str):
|
|
58
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
59
|
-
return self.__str__() == other
|
|
60
|
-
return NotImplemented
|
|
61
|
-
|
|
62
|
-
def __hash__(self) -> int:
|
|
63
|
-
return super().__hash__()
|
|
64
|
-
|
|
65
|
-
def __getitem__(self, item: int | slice) -> str:
|
|
66
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
67
|
-
return self.__str__()[item]
|
|
68
|
-
|
|
69
|
-
def __len__(self) -> int:
|
|
70
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
71
|
-
return len(self.__str__())
|
|
72
|
-
else:
|
|
73
|
-
class _StrPath(PosixPath):
|
|
74
|
-
def replace( # type: ignore[override]
|
|
75
|
-
self, old: str, new: str, count: int = -1, /,
|
|
76
|
-
) -> str:
|
|
77
|
-
# replace exists in both Path and str;
|
|
78
|
-
# in Path it makes filesystem changes, so we use the safer str version
|
|
79
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
80
|
-
return self.__str__().replace(old, new, count) # NoQA: PLC2801
|
|
81
|
-
|
|
82
|
-
def __getattr__(self, item: str) -> Any:
|
|
83
|
-
if item in _STR_METHODS:
|
|
84
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
85
|
-
return getattr(self.__str__(), item)
|
|
86
|
-
msg = f'{_PATH_NAME!r} has no attribute {item!r}'
|
|
87
|
-
raise AttributeError(msg)
|
|
88
|
-
|
|
89
|
-
def __add__(self, other: str) -> str:
|
|
90
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
91
|
-
return self.__str__() + other
|
|
92
|
-
|
|
93
|
-
def __bool__(self) -> bool:
|
|
94
|
-
if not self.__str__():
|
|
95
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
96
|
-
return False
|
|
97
|
-
return True
|
|
98
|
-
|
|
99
|
-
def __contains__(self, item: str) -> bool:
|
|
100
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
101
|
-
return item in self.__str__()
|
|
102
|
-
|
|
103
|
-
def __eq__(self, other: object) -> bool:
|
|
104
|
-
if isinstance(other, PurePath):
|
|
105
|
-
return super().__eq__(other)
|
|
106
|
-
if isinstance(other, str):
|
|
107
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
108
|
-
return self.__str__() == other
|
|
109
|
-
return NotImplemented
|
|
110
|
-
|
|
111
|
-
def __hash__(self) -> int:
|
|
112
|
-
return super().__hash__()
|
|
113
|
-
|
|
114
|
-
def __getitem__(self, item: int | slice) -> str:
|
|
115
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
116
|
-
return self.__str__()[item]
|
|
117
|
-
|
|
118
|
-
def __len__(self) -> int:
|
|
119
|
-
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
|
|
120
|
-
return len(self.__str__())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|