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.

Files changed (115) hide show
  1. sphinx/__init__.py +2 -2
  2. sphinx/_cli/__init__.py +4 -4
  3. sphinx/application.py +7 -7
  4. sphinx/builders/__init__.py +2 -3
  5. sphinx/builders/_epub_base.py +33 -12
  6. sphinx/builders/changes.py +13 -5
  7. sphinx/builders/epub3.py +6 -2
  8. sphinx/builders/html/__init__.py +90 -59
  9. sphinx/builders/latex/__init__.py +38 -12
  10. sphinx/builders/latex/transforms.py +1 -1
  11. sphinx/builders/linkcheck.py +8 -49
  12. sphinx/builders/texinfo.py +12 -6
  13. sphinx/builders/text.py +7 -3
  14. sphinx/builders/xml.py +7 -3
  15. sphinx/cmd/quickstart.py +10 -20
  16. sphinx/config.py +12 -12
  17. sphinx/deprecation.py +8 -8
  18. sphinx/directives/__init__.py +14 -9
  19. sphinx/directives/other.py +2 -3
  20. sphinx/directives/patches.py +2 -2
  21. sphinx/domains/__init__.py +4 -2
  22. sphinx/domains/c/__init__.py +2 -2
  23. sphinx/domains/c/_ast.py +3 -2
  24. sphinx/domains/c/_parser.py +4 -3
  25. sphinx/domains/cpp/__init__.py +2 -2
  26. sphinx/domains/cpp/_ast.py +1 -2
  27. sphinx/domains/cpp/_parser.py +2 -2
  28. sphinx/domains/cpp/_symbol.py +2 -2
  29. sphinx/domains/javascript.py +1 -1
  30. sphinx/domains/math.py +1 -1
  31. sphinx/domains/python/__init__.py +1 -1
  32. sphinx/domains/python/_annotations.py +23 -1
  33. sphinx/domains/python/_object.py +0 -1
  34. sphinx/domains/std/__init__.py +7 -8
  35. sphinx/environment/__init__.py +14 -32
  36. sphinx/environment/adapters/indexentries.py +4 -6
  37. sphinx/environment/adapters/toctree.py +4 -4
  38. sphinx/environment/collectors/title.py +1 -1
  39. sphinx/environment/collectors/toctree.py +1 -1
  40. sphinx/events.py +3 -1
  41. sphinx/ext/autodoc/__init__.py +25 -67
  42. sphinx/ext/autodoc/directive.py +7 -5
  43. sphinx/ext/autodoc/importer.py +2 -1
  44. sphinx/ext/autodoc/preserve_defaults.py +2 -2
  45. sphinx/ext/autosummary/__init__.py +15 -7
  46. sphinx/ext/autosummary/generate.py +5 -4
  47. sphinx/ext/doctest.py +5 -5
  48. sphinx/ext/graphviz.py +1 -1
  49. sphinx/ext/imgmath.py +1 -1
  50. sphinx/ext/inheritance_diagram.py +1 -1
  51. sphinx/ext/intersphinx/__init__.py +25 -5
  52. sphinx/ext/intersphinx/_cli.py +7 -6
  53. sphinx/ext/intersphinx/_load.py +240 -115
  54. sphinx/ext/intersphinx/_resolve.py +12 -11
  55. sphinx/ext/intersphinx/_shared.py +102 -9
  56. sphinx/ext/mathjax.py +1 -1
  57. sphinx/ext/napoleon/docstring.py +2 -2
  58. sphinx/ext/todo.py +2 -2
  59. sphinx/ext/viewcode.py +2 -1
  60. sphinx/highlighting.py +3 -3
  61. sphinx/io.py +2 -2
  62. sphinx/jinja2glue.py +13 -6
  63. sphinx/locale/__init__.py +4 -3
  64. sphinx/locale/ta/LC_MESSAGES/sphinx.js +54 -54
  65. sphinx/locale/ta/LC_MESSAGES/sphinx.mo +0 -0
  66. sphinx/locale/ta/LC_MESSAGES/sphinx.po +1578 -1843
  67. sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +496 -704
  68. sphinx/project.py +23 -19
  69. sphinx/pycode/ast.py +2 -2
  70. sphinx/pycode/parser.py +2 -2
  71. sphinx/pygments_styles.py +3 -3
  72. sphinx/registry.py +3 -8
  73. sphinx/search/__init__.py +1 -1
  74. sphinx/testing/path.py +2 -1
  75. sphinx/testing/util.py +1 -1
  76. sphinx/texinputs/Makefile.jinja +2 -1
  77. sphinx/texinputs_win/Makefile.jinja +2 -1
  78. sphinx/theming.py +3 -12
  79. sphinx/transforms/__init__.py +5 -5
  80. sphinx/transforms/references.py +1 -1
  81. sphinx/util/__init__.py +11 -35
  82. sphinx/util/_timestamps.py +12 -0
  83. sphinx/util/cfamily.py +5 -5
  84. sphinx/util/console.py +4 -3
  85. sphinx/util/display.py +3 -3
  86. sphinx/util/docfields.py +1 -1
  87. sphinx/util/docutils.py +44 -10
  88. sphinx/util/fileutil.py +41 -9
  89. sphinx/util/i18n.py +9 -4
  90. sphinx/util/images.py +3 -2
  91. sphinx/util/inspect.py +29 -44
  92. sphinx/util/inventory.py +2 -2
  93. sphinx/util/matching.py +2 -2
  94. sphinx/util/math.py +1 -1
  95. sphinx/util/nodes.py +8 -8
  96. sphinx/util/osutil.py +46 -23
  97. sphinx/util/parallel.py +2 -2
  98. sphinx/util/requests.py +1 -1
  99. sphinx/util/template.py +3 -3
  100. sphinx/util/typing.py +67 -70
  101. sphinx/writers/html.py +1 -1
  102. sphinx/writers/html5.py +1 -1
  103. sphinx/writers/latex.py +4 -4
  104. sphinx/writers/manpage.py +2 -2
  105. sphinx/writers/texinfo.py +5 -5
  106. sphinx/writers/text.py +4 -4
  107. sphinx/writers/xml.py +2 -2
  108. {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/METADATA +10 -9
  109. {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/RECORD +112 -114
  110. sphinx/templates/quickstart/Makefile.jinja +0 -98
  111. sphinx/templates/quickstart/make.bat.jinja +0 -110
  112. sphinx/util/_pathlib.py +0 -120
  113. {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/LICENSE.rst +0 -0
  114. {sphinx-7.4.6.dist-info → sphinx-8.0.0rc1.dist-info}/WHEEL +0 -0
  115. {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__())