Sphinx 8.0.0rc1__py3-none-any.whl → 8.0.2__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 (141) hide show
  1. sphinx/__init__.py +2 -2
  2. sphinx/application.py +5 -5
  3. sphinx/builders/linkcheck.py +3 -3
  4. sphinx/config.py +1 -1
  5. sphinx/environment/__init__.py +2 -1
  6. sphinx/highlighting.py +6 -0
  7. sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
  8. sphinx/locale/ar/LC_MESSAGES/sphinx.po +2383 -2186
  9. sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
  10. sphinx/locale/bg/LC_MESSAGES/sphinx.po +2249 -2052
  11. sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
  12. sphinx/locale/bn/LC_MESSAGES/sphinx.po +2412 -2215
  13. sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
  14. sphinx/locale/ca/LC_MESSAGES/sphinx.po +3029 -2832
  15. sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
  16. sphinx/locale/cak/LC_MESSAGES/sphinx.po +2308 -2111
  17. sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
  18. sphinx/locale/cs/LC_MESSAGES/sphinx.po +2469 -2272
  19. sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
  20. sphinx/locale/cy/LC_MESSAGES/sphinx.po +2393 -2196
  21. sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
  22. sphinx/locale/da/LC_MESSAGES/sphinx.po +2532 -2335
  23. sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
  24. sphinx/locale/de/LC_MESSAGES/sphinx.po +2492 -2295
  25. sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
  26. sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +2250 -2053
  27. sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
  28. sphinx/locale/el/LC_MESSAGES/sphinx.po +2879 -2682
  29. sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
  30. sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +2250 -2053
  31. sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
  32. sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +2250 -2053
  33. sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
  34. sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +2989 -2792
  35. sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
  36. sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +2250 -2053
  37. sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
  38. sphinx/locale/eo/LC_MESSAGES/sphinx.po +2297 -2100
  39. sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
  40. sphinx/locale/es/LC_MESSAGES/sphinx.po +3017 -2820
  41. sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
  42. sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +2250 -2053
  43. sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
  44. sphinx/locale/et/LC_MESSAGES/sphinx.po +2748 -2551
  45. sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
  46. sphinx/locale/eu/LC_MESSAGES/sphinx.po +2459 -2262
  47. sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
  48. sphinx/locale/fa/LC_MESSAGES/sphinx.po +2957 -2760
  49. sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
  50. sphinx/locale/fi/LC_MESSAGES/sphinx.po +2321 -2124
  51. sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
  52. sphinx/locale/fr/LC_MESSAGES/sphinx.po +2977 -2780
  53. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
  54. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +2250 -2053
  55. sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
  56. sphinx/locale/gl/LC_MESSAGES/sphinx.po +2992 -2795
  57. sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
  58. sphinx/locale/he/LC_MESSAGES/sphinx.po +2375 -2178
  59. sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
  60. sphinx/locale/hi/LC_MESSAGES/sphinx.po +2937 -2740
  61. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
  62. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +2250 -2053
  63. sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
  64. sphinx/locale/hr/LC_MESSAGES/sphinx.po +2532 -2335
  65. sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
  66. sphinx/locale/hu/LC_MESSAGES/sphinx.po +2505 -2308
  67. sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
  68. sphinx/locale/id/LC_MESSAGES/sphinx.po +2925 -2728
  69. sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
  70. sphinx/locale/is/LC_MESSAGES/sphinx.po +2307 -2110
  71. sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
  72. sphinx/locale/it/LC_MESSAGES/sphinx.po +2514 -2317
  73. sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
  74. sphinx/locale/ja/LC_MESSAGES/sphinx.po +2970 -2773
  75. sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
  76. sphinx/locale/ka/LC_MESSAGES/sphinx.po +2868 -2671
  77. sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
  78. sphinx/locale/ko/LC_MESSAGES/sphinx.po +3016 -2819
  79. sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
  80. sphinx/locale/lt/LC_MESSAGES/sphinx.po +2476 -2279
  81. sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
  82. sphinx/locale/lv/LC_MESSAGES/sphinx.po +2477 -2280
  83. sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
  84. sphinx/locale/mk/LC_MESSAGES/sphinx.po +2292 -2095
  85. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
  86. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +2479 -2282
  87. sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
  88. sphinx/locale/ne/LC_MESSAGES/sphinx.po +2481 -2284
  89. sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
  90. sphinx/locale/nl/LC_MESSAGES/sphinx.po +2557 -2360
  91. sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
  92. sphinx/locale/pl/LC_MESSAGES/sphinx.po +2696 -2499
  93. sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
  94. sphinx/locale/pt/LC_MESSAGES/sphinx.po +2250 -2053
  95. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
  96. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +2979 -2782
  97. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
  98. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +2469 -2272
  99. sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
  100. sphinx/locale/ro/LC_MESSAGES/sphinx.po +2473 -2276
  101. sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
  102. sphinx/locale/ru/LC_MESSAGES/sphinx.po +2746 -2549
  103. sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
  104. sphinx/locale/si/LC_MESSAGES/sphinx.po +2331 -2134
  105. sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
  106. sphinx/locale/sk/LC_MESSAGES/sphinx.po +2966 -2769
  107. sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
  108. sphinx/locale/sl/LC_MESSAGES/sphinx.po +2404 -2207
  109. sphinx/locale/sphinx.pot +2262 -2065
  110. sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
  111. sphinx/locale/sq/LC_MESSAGES/sphinx.po +2972 -2775
  112. sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
  113. sphinx/locale/sr/LC_MESSAGES/sphinx.po +2440 -2243
  114. sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
  115. sphinx/locale/sv/LC_MESSAGES/sphinx.po +2483 -2286
  116. sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
  117. sphinx/locale/te/LC_MESSAGES/sphinx.po +2250 -2053
  118. sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
  119. sphinx/locale/tr/LC_MESSAGES/sphinx.po +2892 -2695
  120. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
  121. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +2400 -2203
  122. sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
  123. sphinx/locale/ur/LC_MESSAGES/sphinx.po +2250 -2053
  124. sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
  125. sphinx/locale/vi/LC_MESSAGES/sphinx.po +2422 -2225
  126. sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
  127. sphinx/locale/yue/LC_MESSAGES/sphinx.po +2250 -2053
  128. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
  129. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +2250 -2053
  130. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
  131. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +3028 -2831
  132. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
  133. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +2250 -2053
  134. sphinx/project.py +5 -4
  135. sphinx/util/_pathlib.py +132 -0
  136. sphinx/util/osutil.py +8 -5
  137. {sphinx-8.0.0rc1.dist-info → sphinx-8.0.2.dist-info}/METADATA +3 -3
  138. {sphinx-8.0.0rc1.dist-info → sphinx-8.0.2.dist-info}/RECORD +141 -140
  139. {sphinx-8.0.0rc1.dist-info → sphinx-8.0.2.dist-info}/LICENSE.rst +0 -0
  140. {sphinx-8.0.0rc1.dist-info → sphinx-8.0.2.dist-info}/WHEEL +0 -0
  141. {sphinx-8.0.0rc1.dist-info → sphinx-8.0.2.dist-info}/entry_points.txt +0 -0
sphinx/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """The Sphinx documentation toolchain."""
2
2
 
3
- __version__ = '8.0.0rc1'
3
+ __version__ = '8.0.2'
4
4
  __display_version__ = __version__ # used for command line version
5
5
 
6
6
  # Keep this file executable as-is in Python 3!
@@ -27,7 +27,7 @@ warnings.filterwarnings(
27
27
  #:
28
28
  #: .. versionadded:: 1.2
29
29
  #: Before version 1.2, check the string ``sphinx.__version__``.
30
- version_info = (8, 0, 0, 'candidate', 1)
30
+ version_info = (8, 0, 2, 'final', 0)
31
31
 
32
32
  package_dir = os.path.abspath(os.path.dirname(__file__))
33
33
 
sphinx/application.py CHANGED
@@ -13,7 +13,6 @@ from collections import deque
13
13
  from collections.abc import Callable, Collection, Sequence # NoQA: TCH003
14
14
  from io import StringIO
15
15
  from os import path
16
- from pathlib import Path
17
16
  from typing import IO, TYPE_CHECKING, Any, Literal
18
17
 
19
18
  from docutils.nodes import TextElement # NoQA: TCH002
@@ -32,6 +31,7 @@ from sphinx.locale import __
32
31
  from sphinx.project import Project
33
32
  from sphinx.registry import SphinxComponentRegistry
34
33
  from sphinx.util import docutils, logging
34
+ from sphinx.util._pathlib import _StrPath
35
35
  from sphinx.util.build_phase import BuildPhase
36
36
  from sphinx.util.console import bold
37
37
  from sphinx.util.display import progress_message
@@ -173,9 +173,9 @@ class Sphinx:
173
173
  self.registry = SphinxComponentRegistry()
174
174
 
175
175
  # validate provided directories
176
- self.srcdir = Path(srcdir).resolve()
177
- self.outdir = Path(outdir).resolve()
178
- self.doctreedir = Path(doctreedir).resolve()
176
+ self.srcdir = _StrPath(srcdir).resolve()
177
+ self.outdir = _StrPath(outdir).resolve()
178
+ self.doctreedir = _StrPath(doctreedir).resolve()
179
179
 
180
180
  if not path.isdir(self.srcdir):
181
181
  raise ApplicationError(__('Cannot find source directory (%s)') %
@@ -231,7 +231,7 @@ class Sphinx:
231
231
  self.confdir = self.srcdir
232
232
  self.config = Config({}, confoverrides or {})
233
233
  else:
234
- self.confdir = Path(confdir).resolve()
234
+ self.confdir = _StrPath(confdir).resolve()
235
235
  self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
236
236
 
237
237
  # set up translation infrastructure
@@ -28,13 +28,13 @@ from sphinx.util.nodes import get_node_line
28
28
 
29
29
  if TYPE_CHECKING:
30
30
  from collections.abc import Callable, Iterator
31
- from pathlib import Path
32
31
  from typing import Any
33
32
 
34
33
  from requests import Response
35
34
 
36
35
  from sphinx.application import Sphinx
37
36
  from sphinx.config import Config
37
+ from sphinx.util._pathlib import _StrPath
38
38
  from sphinx.util.typing import ExtensionMetadata
39
39
 
40
40
  logger = logging.getLogger(__name__)
@@ -150,7 +150,7 @@ class CheckExternalLinksBuilder(DummyBuilder):
150
150
  self.json_outfile.write(json.dumps(data))
151
151
  self.json_outfile.write('\n')
152
152
 
153
- def write_entry(self, what: str, docname: str, filename: Path, line: int,
153
+ def write_entry(self, what: str, docname: str, filename: _StrPath, line: int,
154
154
  uri: str) -> None:
155
155
  self.txt_outfile.write(f'{filename}:{line}: [{what}] {uri}\n')
156
156
 
@@ -226,7 +226,7 @@ class HyperlinkCollector(SphinxPostTransform):
226
226
  class Hyperlink(NamedTuple):
227
227
  uri: str
228
228
  docname: str
229
- docpath: Path
229
+ docpath: _StrPath
230
230
  lineno: int
231
231
 
232
232
 
sphinx/config.py CHANGED
@@ -590,7 +590,7 @@ def convert_source_suffix(app: Sphinx, config: Config) -> None:
590
590
  logger.info(__("Converting `source_suffix = %r` to `source_suffix = %r`."),
591
591
  source_suffix, config.source_suffix)
592
592
  elif not isinstance(source_suffix, dict):
593
- msg = __("The config value `source_suffix' expects a dictionary,"
593
+ msg = __("The config value `source_suffix' expects a dictionary, "
594
594
  "a string, or a list of strings. Got `%r' instead (type %s).")
595
595
  raise ConfigError(msg % (source_suffix, type(source_suffix)))
596
596
 
@@ -36,6 +36,7 @@ if TYPE_CHECKING:
36
36
  from sphinx.domains import Domain
37
37
  from sphinx.events import EventManager
38
38
  from sphinx.project import Project
39
+ from sphinx.util._pathlib import _StrPath
39
40
 
40
41
  logger = logging.getLogger(__name__)
41
42
 
@@ -413,7 +414,7 @@ class BuildEnvironment:
413
414
  """
414
415
  return self.project.path2doc(filename)
415
416
 
416
- def doc2path(self, docname: str, base: bool = True) -> Path:
417
+ def doc2path(self, docname: str, base: bool = True) -> _StrPath:
417
418
  """Return the filename for the document name.
418
419
 
419
420
  If *base* is True, return absolute path under self.srcdir.
sphinx/highlighting.py CHANGED
@@ -6,6 +6,7 @@ from functools import partial
6
6
  from importlib import import_module
7
7
  from typing import TYPE_CHECKING, Any
8
8
 
9
+ import pygments
9
10
  from pygments import highlight
10
11
  from pygments.filters import ErrorToken
11
12
  from pygments.formatters import HtmlFormatter, LatexFormatter
@@ -30,6 +31,11 @@ if TYPE_CHECKING:
30
31
  from pygments.lexer import Lexer
31
32
  from pygments.style import Style
32
33
 
34
+ if tuple(map(int, pygments.__version__.split('.')))[:2] < (2, 18):
35
+ from pygments.formatter import Formatter # NoQA: F811
36
+
37
+ Formatter.__class_getitem__ = classmethod(lambda cls, name: cls) # type: ignore[attr-defined]
38
+
33
39
  logger = logging.getLogger(__name__)
34
40
 
35
41
  lexers: dict[str, Lexer] = {}
Binary file