Sphinx 8.2.0rc2__py3-none-any.whl → 8.3.0__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 (156) hide show
  1. sphinx/__init__.py +19 -18
  2. sphinx/application.py +1 -0
  3. sphinx/deprecation.py +7 -0
  4. sphinx/ext/apidoc/_extension.py +2 -1
  5. sphinx/ext/autodoc/__init__.py +1 -1
  6. sphinx/ext/autodoc/directive.py +1 -1
  7. sphinx/ext/autodoc/mock.py +1 -1
  8. sphinx/ext/napoleon/__init__.py +23 -24
  9. sphinx/ext/viewcode.py +12 -8
  10. sphinx/highlighting.py +1 -1
  11. sphinx/locale/__init__.py +4 -3
  12. sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
  13. sphinx/locale/ar/LC_MESSAGES/sphinx.po +2155 -2050
  14. sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
  15. sphinx/locale/bg/LC_MESSAGES/sphinx.po +2045 -1940
  16. sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
  17. sphinx/locale/bn/LC_MESSAGES/sphinx.po +2175 -2070
  18. sphinx/locale/ca/LC_MESSAGES/sphinx.js +3 -3
  19. sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
  20. sphinx/locale/ca/LC_MESSAGES/sphinx.po +2690 -2585
  21. sphinx/locale/ca@valencia/LC_MESSAGES/sphinx.js +63 -0
  22. sphinx/locale/ca@valencia/LC_MESSAGES/sphinx.mo +0 -0
  23. sphinx/locale/ca@valencia/LC_MESSAGES/sphinx.po +4216 -0
  24. sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
  25. sphinx/locale/cak/LC_MESSAGES/sphinx.po +2096 -1991
  26. sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
  27. sphinx/locale/cs/LC_MESSAGES/sphinx.po +2248 -2143
  28. sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
  29. sphinx/locale/cy/LC_MESSAGES/sphinx.po +2201 -2096
  30. sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
  31. sphinx/locale/da/LC_MESSAGES/sphinx.po +2282 -2177
  32. sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
  33. sphinx/locale/de/LC_MESSAGES/sphinx.po +2261 -2156
  34. sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
  35. sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +2045 -1940
  36. sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
  37. sphinx/locale/el/LC_MESSAGES/sphinx.po +2604 -2499
  38. sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
  39. sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +2045 -1940
  40. sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
  41. sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +2045 -1940
  42. sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
  43. sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +2631 -2526
  44. sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
  45. sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +2045 -1940
  46. sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
  47. sphinx/locale/eo/LC_MESSAGES/sphinx.po +2078 -1973
  48. sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
  49. sphinx/locale/es/LC_MESSAGES/sphinx.po +2633 -2528
  50. sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
  51. sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +2045 -1940
  52. sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
  53. sphinx/locale/et/LC_MESSAGES/sphinx.po +2449 -2344
  54. sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
  55. sphinx/locale/eu/LC_MESSAGES/sphinx.po +2241 -2136
  56. sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
  57. sphinx/locale/fa/LC_MESSAGES/sphinx.po +504 -500
  58. sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
  59. sphinx/locale/fi/LC_MESSAGES/sphinx.po +499 -495
  60. sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
  61. sphinx/locale/fr/LC_MESSAGES/sphinx.po +513 -509
  62. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
  63. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +499 -495
  64. sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
  65. sphinx/locale/gl/LC_MESSAGES/sphinx.po +2644 -2539
  66. sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
  67. sphinx/locale/he/LC_MESSAGES/sphinx.po +499 -495
  68. sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
  69. sphinx/locale/hi/LC_MESSAGES/sphinx.po +504 -500
  70. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
  71. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +499 -495
  72. sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
  73. sphinx/locale/hr/LC_MESSAGES/sphinx.po +501 -497
  74. sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
  75. sphinx/locale/hu/LC_MESSAGES/sphinx.po +499 -495
  76. sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
  77. sphinx/locale/id/LC_MESSAGES/sphinx.po +2609 -2504
  78. sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
  79. sphinx/locale/is/LC_MESSAGES/sphinx.po +499 -495
  80. sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
  81. sphinx/locale/it/LC_MESSAGES/sphinx.po +2265 -2160
  82. sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
  83. sphinx/locale/ja/LC_MESSAGES/sphinx.po +2621 -2516
  84. sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
  85. sphinx/locale/ka/LC_MESSAGES/sphinx.po +2567 -2462
  86. sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
  87. sphinx/locale/ko/LC_MESSAGES/sphinx.po +2631 -2526
  88. sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
  89. sphinx/locale/lt/LC_MESSAGES/sphinx.po +2214 -2109
  90. sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
  91. sphinx/locale/lv/LC_MESSAGES/sphinx.po +2218 -2113
  92. sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
  93. sphinx/locale/mk/LC_MESSAGES/sphinx.po +2088 -1983
  94. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
  95. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +2247 -2142
  96. sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
  97. sphinx/locale/ne/LC_MESSAGES/sphinx.po +2227 -2122
  98. sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
  99. sphinx/locale/nl/LC_MESSAGES/sphinx.po +2316 -2211
  100. sphinx/locale/pl/LC_MESSAGES/sphinx.js +2 -2
  101. sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
  102. sphinx/locale/pl/LC_MESSAGES/sphinx.po +2442 -2336
  103. sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
  104. sphinx/locale/pt/LC_MESSAGES/sphinx.po +2045 -1940
  105. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
  106. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +2657 -2552
  107. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
  108. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +2243 -2138
  109. sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
  110. sphinx/locale/ro/LC_MESSAGES/sphinx.po +2244 -2139
  111. sphinx/locale/ru/LC_MESSAGES/sphinx.js +1 -1
  112. sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
  113. sphinx/locale/ru/LC_MESSAGES/sphinx.po +2660 -2555
  114. sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
  115. sphinx/locale/si/LC_MESSAGES/sphinx.po +2134 -2029
  116. sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
  117. sphinx/locale/sk/LC_MESSAGES/sphinx.po +2614 -2509
  118. sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
  119. sphinx/locale/sl/LC_MESSAGES/sphinx.po +2167 -2062
  120. sphinx/locale/sphinx.pot +2069 -1964
  121. sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
  122. sphinx/locale/sq/LC_MESSAGES/sphinx.po +2661 -2556
  123. sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
  124. sphinx/locale/sr/LC_MESSAGES/sphinx.po +2213 -2108
  125. sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
  126. sphinx/locale/sv/LC_MESSAGES/sphinx.po +2229 -2124
  127. sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
  128. sphinx/locale/te/LC_MESSAGES/sphinx.po +2045 -1940
  129. sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
  130. sphinx/locale/tr/LC_MESSAGES/sphinx.po +2608 -2503
  131. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
  132. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +2167 -2062
  133. sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
  134. sphinx/locale/ur/LC_MESSAGES/sphinx.po +2045 -1940
  135. sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
  136. sphinx/locale/vi/LC_MESSAGES/sphinx.po +2204 -2099
  137. sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
  138. sphinx/locale/yue/LC_MESSAGES/sphinx.po +2045 -1940
  139. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
  140. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +2045 -1940
  141. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
  142. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +2659 -2554
  143. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
  144. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +2045 -1940
  145. sphinx/search/zh.py +23 -13
  146. sphinx/testing/path.py +8 -0
  147. sphinx/themes/basic/static/basic.css.jinja +0 -8
  148. sphinx/util/__init__.py +7 -0
  149. sphinx/util/_files.py +2 -2
  150. sphinx/util/fileutil.py +2 -1
  151. sphinx/util/osutil.py +6 -1
  152. {sphinx-8.2.0rc2.dist-info → sphinx-8.3.0.dist-info}/METADATA +7 -6
  153. {sphinx-8.2.0rc2.dist-info → sphinx-8.3.0.dist-info}/RECORD +156 -153
  154. {sphinx-8.2.0rc2.dist-info → sphinx-8.3.0.dist-info}/WHEEL +1 -1
  155. {sphinx-8.2.0rc2.dist-info → sphinx-8.3.0.dist-info}/entry_points.txt +0 -0
  156. {sphinx-8.2.0rc2.dist-info → sphinx-8.3.0.dist-info/licenses}/LICENSE.rst +0 -0
sphinx/search/zh.py CHANGED
@@ -4,19 +4,33 @@ from __future__ import annotations
4
4
 
5
5
  import re
6
6
  from pathlib import Path
7
+ from typing import TYPE_CHECKING
7
8
 
8
9
  import snowballstemmer
9
10
 
10
11
  from sphinx.search import SearchLanguage
11
12
 
13
+ if TYPE_CHECKING:
14
+ from collections.abc import Iterator
15
+
12
16
  try:
13
17
  import jieba # type: ignore[import-not-found]
14
-
15
- JIEBA = True
16
- JIEBA_DEFAULT_DICT = Path(jieba.__file__).parent / jieba.DEFAULT_DICT_NAME
18
+ from jieba import cut_for_search
19
+ from jieba import load_userdict as jieba_load_userdict
17
20
  except ImportError:
18
- JIEBA = False
19
- JIEBA_DEFAULT_DICT = Path()
21
+ JIEBA_DEFAULT_DICT = ''
22
+
23
+ def jieba_load_userdict(f: str) -> None:
24
+ pass
25
+
26
+ def cut_for_search(sentence: str, HMM: bool = True) -> Iterator[str]:
27
+ yield from ()
28
+
29
+ else:
30
+ JIEBA_DEFAULT_DICT = (
31
+ Path(jieba.__file__, '..', jieba.DEFAULT_DICT_NAME).resolve().as_posix()
32
+ )
33
+ del jieba
20
34
 
21
35
  english_stopwords = {
22
36
  'a', 'and', 'are', 'as', 'at',
@@ -231,18 +245,14 @@ class SearchChinese(SearchLanguage):
231
245
  self.latin_terms: set[str] = set()
232
246
 
233
247
  def init(self, options: dict[str, str]) -> None:
234
- if JIEBA:
235
- dict_path = options.get('dict', JIEBA_DEFAULT_DICT)
236
- if dict_path and Path(dict_path).is_file():
237
- jieba.load_userdict(dict_path)
248
+ dict_path = options.get('dict', JIEBA_DEFAULT_DICT)
249
+ if dict_path and Path(dict_path).is_file():
250
+ jieba_load_userdict(str(dict_path))
238
251
 
239
252
  self.stemmer = snowballstemmer.stemmer('english')
240
253
 
241
254
  def split(self, input: str) -> list[str]:
242
- if JIEBA:
243
- chinese: list[str] = list(jieba.cut_for_search(input))
244
- else:
245
- chinese = []
255
+ chinese: list[str] = list(cut_for_search(input))
246
256
 
247
257
  latin1 = [term.strip() for term in self.latin1_letters.findall(input)]
248
258
  self.latin_terms.update(latin1)
sphinx/testing/path.py CHANGED
@@ -58,18 +58,26 @@ class path(str): # NoQA: FURB189
58
58
  """Returns ``True`` if the path is a directory."""
59
59
  return os.path.isdir(self)
60
60
 
61
+ is_dir = isdir
62
+
61
63
  def isfile(self) -> bool:
62
64
  """Returns ``True`` if the path is a file."""
63
65
  return os.path.isfile(self)
64
66
 
67
+ is_file = isfile
68
+
65
69
  def islink(self) -> bool:
66
70
  """Returns ``True`` if the path is a symbolic link."""
67
71
  return os.path.islink(self)
68
72
 
73
+ is_symlink = islink
74
+
69
75
  def ismount(self) -> bool:
70
76
  """Returns ``True`` if the path is a mount point."""
71
77
  return os.path.ismount(self)
72
78
 
79
+ is_mount = ismount
80
+
73
81
  def rmtree(
74
82
  self,
75
83
  ignore_errors: bool = False,
@@ -741,14 +741,6 @@ abbr, acronym {
741
741
  cursor: help;
742
742
  }
743
743
 
744
- .translated {
745
- background-color: rgba(207, 255, 207, 0.2)
746
- }
747
-
748
- .untranslated {
749
- background-color: rgba(255, 207, 207, 0.2)
750
- }
751
-
752
744
  /* -- code displays --------------------------------------------------------- */
753
745
 
754
746
  pre {
sphinx/util/__init__.py CHANGED
@@ -62,6 +62,13 @@ def __getattr__(name: str) -> Any:
62
62
  obj: Callable[..., Any]
63
63
  mod: ModuleType
64
64
 
65
+ if name == 'console':
66
+ # Explicit temporary workaround for nbsphinx implicit imports.
67
+ # https://github.com/sphinx-doc/sphinx/issues/13352
68
+ import sphinx.util.console as mod
69
+
70
+ return mod
71
+
65
72
  # RemovedInSphinx90Warning
66
73
  if name == 'split_index_msg':
67
74
  from sphinx.util.index_entries import split_index_msg as obj
sphinx/util/_files.py CHANGED
@@ -11,7 +11,7 @@ if TYPE_CHECKING:
11
11
  from collections.abc import Set
12
12
 
13
13
 
14
- class FilenameUniqDict(dict[str, tuple[set[str], str]]):
14
+ class FilenameUniqDict(dict[str, tuple[set[str], str]]): # NoQA: FURB189
15
15
  """A dictionary that automatically generates unique names for its keys,
16
16
  interpreted as filenames, and keeps track of a set of docnames they
17
17
  appear in. Used for images and downloadable files in the environment.
@@ -61,7 +61,7 @@ class FilenameUniqDict(dict[str, tuple[set[str], str]]):
61
61
  self._existing = state
62
62
 
63
63
 
64
- class DownloadFiles(dict[Path, tuple[set[str], _StrPath]]):
64
+ class DownloadFiles(dict[Path, tuple[set[str], _StrPath]]): # NoQA: FURB189
65
65
  """A special dictionary for download files.
66
66
 
67
67
  .. important:: This class would be refactored in nearly future.
sphinx/util/fileutil.py CHANGED
@@ -140,7 +140,8 @@ def copy_asset(
140
140
  return
141
141
 
142
142
  for root, dirs, files in os.walk(source, followlinks=True):
143
- reldir = _relative_path(Path(root), source).as_posix()
143
+ root_p = Path(root)
144
+ reldir = _relative_path(root_p, source).as_posix()
144
145
  for dir in dirs.copy():
145
146
  if excluded(posixpath.join(reldir, dir)):
146
147
  dirs.remove(dir)
sphinx/util/osutil.py CHANGED
@@ -177,9 +177,14 @@ def _relative_path(path: Path, root: Path, /) -> Path:
177
177
  It returns the original path if *path* and *root* are on different drives,
178
178
  which may happen on Windows.
179
179
  """
180
+ # Path.relative_to() requires fully-resolved paths (no '..').
181
+ if '..' in path.parts:
182
+ path = path.resolve()
183
+ if '..' in root.parts:
184
+ root = root.resolve()
185
+
180
186
  if path.anchor != root.anchor or '..' in root.parts:
181
187
  # If the drives are different, no relative path exists.
182
- # Path.relative_to() requires fully-resolved paths (no '..').
183
188
  return path
184
189
  if sys.version_info[:2] < (3, 12):
185
190
  return Path(os.path.relpath(path, root))
@@ -1,10 +1,11 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: Sphinx
3
- Version: 8.2.0rc2
3
+ Version: 8.3.0
4
4
  Summary: Python documentation generator
5
5
  Author-email: Adam Turner <aa-turner@users.noreply.github.com>, Georg Brandl <georg@python.org>
6
6
  Requires-Python: >=3.11
7
7
  Description-Content-Type: text/x-rst
8
+ License-Expression: BSD-2-Clause
8
9
  Classifier: Development Status :: 5 - Production/Stable
9
10
  Classifier: Environment :: Console
10
11
  Classifier: Environment :: Web Environment
@@ -15,7 +16,6 @@ Classifier: Intended Audience :: Information Technology
15
16
  Classifier: Intended Audience :: Other Audience
16
17
  Classifier: Intended Audience :: Science/Research
17
18
  Classifier: Intended Audience :: System Administrators
18
- Classifier: License :: OSI Approved :: BSD License
19
19
  Classifier: Operating System :: OS Independent
20
20
  Classifier: Programming Language :: Python
21
21
  Classifier: Programming Language :: Python :: 3
@@ -50,6 +50,7 @@ Classifier: Topic :: Text Processing :: Markup :: reStructuredText
50
50
  Classifier: Topic :: Text Processing :: Markup :: XML
51
51
  Classifier: Topic :: Utilities
52
52
  Classifier: Typing :: Typed
53
+ License-File: LICENSE.rst
53
54
  Requires-Dist: sphinxcontrib-applehelp>=1.0.7
54
55
  Requires-Dist: sphinxcontrib-devhelp>=1.0.6
55
56
  Requires-Dist: sphinxcontrib-htmlhelp>=2.0.6
@@ -68,17 +69,17 @@ Requires-Dist: roman-numerals-py>=1.0.0
68
69
  Requires-Dist: packaging>=23.0
69
70
  Requires-Dist: colorama>=0.4.6; sys_platform == 'win32'
70
71
  Requires-Dist: sphinxcontrib-websupport ; extra == "docs"
71
- Requires-Dist: ruff==0.9.6 ; extra == "lint"
72
+ Requires-Dist: ruff==0.9.9 ; extra == "lint"
72
73
  Requires-Dist: mypy==1.15.0 ; extra == "lint"
73
74
  Requires-Dist: sphinx-lint>=0.9 ; extra == "lint"
74
75
  Requires-Dist: types-colorama==0.4.15.20240311 ; extra == "lint"
75
76
  Requires-Dist: types-defusedxml==0.7.0.20240218 ; extra == "lint"
76
77
  Requires-Dist: types-docutils==0.21.0.20241128 ; extra == "lint"
77
78
  Requires-Dist: types-Pillow==10.2.0.20240822 ; extra == "lint"
78
- Requires-Dist: types-Pygments==2.19.0.20250107 ; extra == "lint"
79
+ Requires-Dist: types-Pygments==2.19.0.20250219 ; extra == "lint"
79
80
  Requires-Dist: types-requests==2.32.0.20241016 ; extra == "lint"
80
81
  Requires-Dist: types-urllib3==1.26.25.14 ; extra == "lint"
81
- Requires-Dist: pyright==1.1.394 ; extra == "lint"
82
+ Requires-Dist: pyright==1.1.395 ; extra == "lint"
82
83
  Requires-Dist: pytest>=8.0 ; extra == "lint"
83
84
  Requires-Dist: pypi-attestations==0.0.21 ; extra == "lint"
84
85
  Requires-Dist: betterproto==2.0.0b6 ; extra == "lint"