Sphinx 7.4.6__py3-none-any.whl → 7.4.7__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/builders/html/__init__.py +4 -3
- sphinx/directives/__init__.py +14 -9
- sphinx/domains/javascript.py +1 -1
- sphinx/domains/python/__init__.py +1 -1
- sphinx/domains/python/_annotations.py +23 -1
- sphinx/ext/autodoc/__init__.py +8 -4
- sphinx/ext/autosummary/__init__.py +8 -1
- 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/util/fileutil.py +35 -8
- sphinx/util/inspect.py +1 -1
- sphinx/util/osutil.py +24 -2
- sphinx/util/typing.py +36 -3
- {sphinx-7.4.6.dist-info → sphinx-7.4.7.dist-info}/METADATA +1 -1
- {sphinx-7.4.6.dist-info → sphinx-7.4.7.dist-info}/RECORD +21 -21
- {sphinx-7.4.6.dist-info → sphinx-7.4.7.dist-info}/LICENSE.rst +0 -0
- {sphinx-7.4.6.dist-info → sphinx-7.4.7.dist-info}/WHEEL +0 -0
- {sphinx-7.4.6.dist-info → sphinx-7.4.7.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__ = '7.4.
|
|
3
|
+
__version__ = '7.4.7'
|
|
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 = (7, 4,
|
|
30
|
+
version_info = (7, 4, 7, 'final', 0)
|
|
31
31
|
|
|
32
32
|
package_dir = os.path.abspath(os.path.dirname(__file__))
|
|
33
33
|
|
sphinx/builders/html/__init__.py
CHANGED
|
@@ -815,8 +815,8 @@ class StandaloneHTMLBuilder(Builder):
|
|
|
815
815
|
|
|
816
816
|
def copy_theme_static_files(self, context: dict[str, Any]) -> None:
|
|
817
817
|
def onerror(filename: str, error: Exception) -> None:
|
|
818
|
-
|
|
819
|
-
|
|
818
|
+
msg = __("Failed to copy a file in the theme's 'static' directory: %s: %r")
|
|
819
|
+
logger.warning(msg, filename, error)
|
|
820
820
|
|
|
821
821
|
if self.theme:
|
|
822
822
|
for entry in reversed(self.theme.get_theme_dirs()):
|
|
@@ -1142,7 +1142,8 @@ class StandaloneHTMLBuilder(Builder):
|
|
|
1142
1142
|
source_name = path.join(self.outdir, '_sources',
|
|
1143
1143
|
os_path(ctx['sourcename']))
|
|
1144
1144
|
ensuredir(path.dirname(source_name))
|
|
1145
|
-
copyfile(self.env.doc2path(pagename), source_name
|
|
1145
|
+
copyfile(self.env.doc2path(pagename), source_name,
|
|
1146
|
+
__overwrite_warning__=False)
|
|
1146
1147
|
|
|
1147
1148
|
def update_page_context(self, pagename: str, templatename: str,
|
|
1148
1149
|
ctx: dict[str, Any], event_arg: Any) -> None:
|
sphinx/directives/__init__.py
CHANGED
|
@@ -220,21 +220,26 @@ class ObjectDescription(SphinxDirective, Generic[ObjDescT]):
|
|
|
220
220
|
node['domain'] = self.domain
|
|
221
221
|
# 'desctype' is a backwards compatible attribute
|
|
222
222
|
node['objtype'] = node['desctype'] = self.objtype
|
|
223
|
+
|
|
224
|
+
# Copy old option names to new ones
|
|
225
|
+
# xref RemovedInSphinx90Warning
|
|
226
|
+
# deprecate noindex, noindexentry, and nocontentsentry in Sphinx 9.0
|
|
227
|
+
if 'no-index' not in self.options and 'noindex' in self.options:
|
|
228
|
+
self.options['no-index'] = self.options['noindex']
|
|
229
|
+
if 'no-index-entry' not in self.options and 'noindexentry' in self.options:
|
|
230
|
+
self.options['no-index-entry'] = self.options['noindexentry']
|
|
231
|
+
if 'no-contents-entry' not in self.options and 'nocontentsentry' in self.options:
|
|
232
|
+
self.options['no-contents-entry'] = self.options['nocontentsentry']
|
|
233
|
+
|
|
223
234
|
node['no-index'] = node['noindex'] = no_index = (
|
|
224
235
|
'no-index' in self.options
|
|
225
|
-
|
|
226
|
-
# deprecate noindex in Sphinx 9.0
|
|
227
|
-
or 'noindex' in self.options)
|
|
236
|
+
)
|
|
228
237
|
node['no-index-entry'] = node['noindexentry'] = (
|
|
229
238
|
'no-index-entry' in self.options
|
|
230
|
-
|
|
231
|
-
# deprecate noindexentry in Sphinx 9.0
|
|
232
|
-
or 'noindexentry' in self.options)
|
|
239
|
+
)
|
|
233
240
|
node['no-contents-entry'] = node['nocontentsentry'] = (
|
|
234
241
|
'no-contents-entry' in self.options
|
|
235
|
-
|
|
236
|
-
# deprecate nocontentsentry in Sphinx 9.0
|
|
237
|
-
or 'nocontentsentry' in self.options)
|
|
242
|
+
)
|
|
238
243
|
node['no-typesetting'] = ('no-typesetting' in self.options)
|
|
239
244
|
if self.domain:
|
|
240
245
|
node['classes'].append(self.domain)
|
sphinx/domains/javascript.py
CHANGED
|
@@ -309,7 +309,7 @@ class JSModule(SphinxDirective):
|
|
|
309
309
|
def run(self) -> list[Node]:
|
|
310
310
|
mod_name = self.arguments[0].strip()
|
|
311
311
|
self.env.ref_context['js:module'] = mod_name
|
|
312
|
-
no_index = 'no-index' in self.options
|
|
312
|
+
no_index = 'no-index' in self.options
|
|
313
313
|
|
|
314
314
|
content_nodes = self.parse_content_to_nodes(allow_section_headings=True)
|
|
315
315
|
|
|
@@ -452,7 +452,7 @@ class PyModule(SphinxDirective):
|
|
|
452
452
|
domain = cast(PythonDomain, self.env.get_domain('py'))
|
|
453
453
|
|
|
454
454
|
modname = self.arguments[0].strip()
|
|
455
|
-
no_index = 'no-index' in self.options
|
|
455
|
+
no_index = 'no-index' in self.options
|
|
456
456
|
self.env.ref_context['py:module'] = modname
|
|
457
457
|
|
|
458
458
|
content_nodes = self.parse_content_to_nodes(allow_section_headings=True)
|
|
@@ -161,7 +161,29 @@ def _parse_annotation(annotation: str, env: BuildEnvironment) -> list[Node]:
|
|
|
161
161
|
addnodes.desc_sig_punctuation('', ')')]
|
|
162
162
|
|
|
163
163
|
return result
|
|
164
|
-
|
|
164
|
+
if isinstance(node, ast.Call):
|
|
165
|
+
# Call nodes can be used in Annotated type metadata,
|
|
166
|
+
# for example Annotated[str, ArbitraryTypeValidator(str, len=10)]
|
|
167
|
+
args = []
|
|
168
|
+
for arg in node.args:
|
|
169
|
+
args += unparse(arg)
|
|
170
|
+
args.append(addnodes.desc_sig_punctuation('', ','))
|
|
171
|
+
args.append(addnodes.desc_sig_space())
|
|
172
|
+
for kwd in node.keywords:
|
|
173
|
+
args.append(addnodes.desc_sig_name(kwd.arg, kwd.arg)) # type: ignore[arg-type]
|
|
174
|
+
args.append(addnodes.desc_sig_operator('', '='))
|
|
175
|
+
args += unparse(kwd.value)
|
|
176
|
+
args.append(addnodes.desc_sig_punctuation('', ','))
|
|
177
|
+
args.append(addnodes.desc_sig_space())
|
|
178
|
+
result = [
|
|
179
|
+
*unparse(node.func),
|
|
180
|
+
addnodes.desc_sig_punctuation('', '('),
|
|
181
|
+
*args[:-2], # skip the final comma and space
|
|
182
|
+
addnodes.desc_sig_punctuation('', ')'),
|
|
183
|
+
]
|
|
184
|
+
return result
|
|
185
|
+
msg = f'unsupported syntax: {node}'
|
|
186
|
+
raise SyntaxError(msg) # unsupported syntax
|
|
165
187
|
|
|
166
188
|
def _unparse_pep_604_annotation(node: ast.Subscript) -> list[Node]:
|
|
167
189
|
subscript = node.slice
|
sphinx/ext/autodoc/__init__.py
CHANGED
|
@@ -2008,7 +2008,8 @@ class UninitializedGlobalVariableMixin(DataDocumenterMixinBase):
|
|
|
2008
2008
|
with mock(self.config.autodoc_mock_imports):
|
|
2009
2009
|
parent = import_module(self.modname, self.config.autodoc_warningiserror)
|
|
2010
2010
|
annotations = get_type_hints(parent, None,
|
|
2011
|
-
self.config.autodoc_type_aliases
|
|
2011
|
+
self.config.autodoc_type_aliases,
|
|
2012
|
+
include_extras=True)
|
|
2012
2013
|
if self.objpath[-1] in annotations:
|
|
2013
2014
|
self.object = UNINITIALIZED_ATTR
|
|
2014
2015
|
self.parent = parent
|
|
@@ -2097,7 +2098,8 @@ class DataDocumenter(GenericAliasMixin,
|
|
|
2097
2098
|
if self.config.autodoc_typehints != 'none':
|
|
2098
2099
|
# obtain annotation for this data
|
|
2099
2100
|
annotations = get_type_hints(self.parent, None,
|
|
2100
|
-
self.config.autodoc_type_aliases
|
|
2101
|
+
self.config.autodoc_type_aliases,
|
|
2102
|
+
include_extras=True)
|
|
2101
2103
|
if self.objpath[-1] in annotations:
|
|
2102
2104
|
if self.config.autodoc_typehints_format == "short":
|
|
2103
2105
|
objrepr = stringify_annotation(annotations.get(self.objpath[-1]),
|
|
@@ -2541,7 +2543,8 @@ class UninitializedInstanceAttributeMixin(DataDocumenterMixinBase):
|
|
|
2541
2543
|
|
|
2542
2544
|
def is_uninitialized_instance_attribute(self, parent: Any) -> bool:
|
|
2543
2545
|
"""Check the subject is an annotation only attribute."""
|
|
2544
|
-
annotations = get_type_hints(parent, None, self.config.autodoc_type_aliases
|
|
2546
|
+
annotations = get_type_hints(parent, None, self.config.autodoc_type_aliases,
|
|
2547
|
+
include_extras=True)
|
|
2545
2548
|
return self.objpath[-1] in annotations
|
|
2546
2549
|
|
|
2547
2550
|
def import_object(self, raiseerror: bool = False) -> bool:
|
|
@@ -2673,7 +2676,8 @@ class AttributeDocumenter(GenericAliasMixin, SlotsMixin, # type: ignore[misc]
|
|
|
2673
2676
|
if self.config.autodoc_typehints != 'none':
|
|
2674
2677
|
# obtain type annotation for this attribute
|
|
2675
2678
|
annotations = get_type_hints(self.parent, None,
|
|
2676
|
-
self.config.autodoc_type_aliases
|
|
2679
|
+
self.config.autodoc_type_aliases,
|
|
2680
|
+
include_extras=True)
|
|
2677
2681
|
if self.objpath[-1] in annotations:
|
|
2678
2682
|
if self.config.autodoc_typehints_format == "short":
|
|
2679
2683
|
objrepr = stringify_annotation(annotations.get(self.objpath[-1]),
|
|
@@ -765,7 +765,14 @@ class AutoLink(SphinxRole):
|
|
|
765
765
|
try:
|
|
766
766
|
# try to import object by name
|
|
767
767
|
prefixes = get_import_prefixes_from_env(self.env)
|
|
768
|
-
|
|
768
|
+
name = pending_xref['reftarget']
|
|
769
|
+
prefixes = [
|
|
770
|
+
prefix
|
|
771
|
+
for prefix in prefixes
|
|
772
|
+
if prefix is None
|
|
773
|
+
or not (name.startswith(f'{prefix}.') or name == prefix)
|
|
774
|
+
]
|
|
775
|
+
import_by_name(name, prefixes)
|
|
769
776
|
except ImportExceptionGroup:
|
|
770
777
|
literal = cast(nodes.literal, pending_xref[0])
|
|
771
778
|
objects[0] = nodes.emphasis(self.rawtext, literal.astext(),
|
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
Documentation.addTranslations({
|
|
2
2
|
"locale": "ta",
|
|
3
3
|
"messages": {
|
|
4
|
-
"%(filename)s — %(docstitle)s": "
|
|
5
|
-
"© %(copyright_prefix)s %(copyright)s.": "
|
|
6
|
-
", in ": "
|
|
7
|
-
"About these documents": "
|
|
8
|
-
"Automatically generated list of changes in version %(version)s": "
|
|
9
|
-
"C API changes": "
|
|
10
|
-
"Changes in Version %(version)s — %(docstitle)s": "
|
|
11
|
-
"Collapse sidebar": "
|
|
12
|
-
"Complete Table of Contents": "
|
|
13
|
-
"Contents": "
|
|
14
|
-
"Copyright": "
|
|
15
|
-
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "
|
|
16
|
-
"Expand sidebar": "
|
|
17
|
-
"Full index on one page": "
|
|
18
|
-
"General Index": "
|
|
19
|
-
"Global Module Index": "
|
|
20
|
-
"Go": "
|
|
21
|
-
"Hide Search Matches": "
|
|
22
|
-
"Index": "
|
|
23
|
-
"Index – %(key)s": "
|
|
24
|
-
"Index pages by letter": "
|
|
25
|
-
"Indices and tables:": "
|
|
26
|
-
"Last updated on %(last_updated)s.": "
|
|
27
|
-
"Library changes": "
|
|
28
|
-
"Navigation": "
|
|
29
|
-
"Next topic": "
|
|
30
|
-
"Other changes": "
|
|
31
|
-
"Overview": "
|
|
32
|
-
"Please activate JavaScript to enable the search\n functionality.": "
|
|
33
|
-
"Preparing search...": "
|
|
34
|
-
"Previous topic": "
|
|
35
|
-
"Quick search": "
|
|
36
|
-
"Search": "
|
|
37
|
-
"Search Page": "
|
|
38
|
-
"Search Results": "
|
|
39
|
-
"Search finished, found ${resultCount} page(s) matching the search query.": "
|
|
40
|
-
"Search within %(docstitle)s": "
|
|
41
|
-
"Searching": "
|
|
42
|
-
"Searching for multiple words only shows matches that contain\n all words.": "
|
|
43
|
-
"Show Source": "
|
|
44
|
-
"Table of Contents": "
|
|
45
|
-
"This Page": "
|
|
46
|
-
"Welcome! This is": "
|
|
47
|
-
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "
|
|
48
|
-
"all functions, classes, terms": "
|
|
49
|
-
"can be huge": "
|
|
50
|
-
"last updated": "
|
|
51
|
-
"lists all sections and subsections": "
|
|
52
|
-
"next chapter": "
|
|
53
|
-
"previous chapter": "
|
|
54
|
-
"quick access to all modules": "
|
|
55
|
-
"search": "
|
|
56
|
-
"search this documentation": "
|
|
57
|
-
"the documentation for": "
|
|
4
|
+
"%(filename)s — %(docstitle)s": "",
|
|
5
|
+
"© %(copyright_prefix)s %(copyright)s.": "",
|
|
6
|
+
", in ": "",
|
|
7
|
+
"About these documents": "",
|
|
8
|
+
"Automatically generated list of changes in version %(version)s": "",
|
|
9
|
+
"C API changes": "",
|
|
10
|
+
"Changes in Version %(version)s — %(docstitle)s": "",
|
|
11
|
+
"Collapse sidebar": "",
|
|
12
|
+
"Complete Table of Contents": "",
|
|
13
|
+
"Contents": "",
|
|
14
|
+
"Copyright": "",
|
|
15
|
+
"Created using <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s.": "",
|
|
16
|
+
"Expand sidebar": "",
|
|
17
|
+
"Full index on one page": "",
|
|
18
|
+
"General Index": "",
|
|
19
|
+
"Global Module Index": "",
|
|
20
|
+
"Go": "",
|
|
21
|
+
"Hide Search Matches": "",
|
|
22
|
+
"Index": "",
|
|
23
|
+
"Index – %(key)s": "",
|
|
24
|
+
"Index pages by letter": "",
|
|
25
|
+
"Indices and tables:": "",
|
|
26
|
+
"Last updated on %(last_updated)s.": "",
|
|
27
|
+
"Library changes": "",
|
|
28
|
+
"Navigation": "",
|
|
29
|
+
"Next topic": "",
|
|
30
|
+
"Other changes": "",
|
|
31
|
+
"Overview": "",
|
|
32
|
+
"Please activate JavaScript to enable the search\n functionality.": "",
|
|
33
|
+
"Preparing search...": "",
|
|
34
|
+
"Previous topic": "",
|
|
35
|
+
"Quick search": "",
|
|
36
|
+
"Search": "",
|
|
37
|
+
"Search Page": "",
|
|
38
|
+
"Search Results": "",
|
|
39
|
+
"Search finished, found ${resultCount} page(s) matching the search query.": "",
|
|
40
|
+
"Search within %(docstitle)s": "",
|
|
41
|
+
"Searching": "",
|
|
42
|
+
"Searching for multiple words only shows matches that contain\n all words.": "",
|
|
43
|
+
"Show Source": "",
|
|
44
|
+
"Table of Contents": "",
|
|
45
|
+
"This Page": "",
|
|
46
|
+
"Welcome! This is": "",
|
|
47
|
+
"Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "",
|
|
48
|
+
"all functions, classes, terms": "",
|
|
49
|
+
"can be huge": "",
|
|
50
|
+
"last updated": "",
|
|
51
|
+
"lists all sections and subsections": "",
|
|
52
|
+
"next chapter": "",
|
|
53
|
+
"previous chapter": "",
|
|
54
|
+
"quick access to all modules": "",
|
|
55
|
+
"search": "",
|
|
56
|
+
"search this documentation": "",
|
|
57
|
+
"the documentation for": ""
|
|
58
58
|
},
|
|
59
59
|
"plural_expr": "(n != 1)"
|
|
60
60
|
});
|
|
Binary file
|