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