Sphinx 7.4.6__py3-none-any.whl → 8.0.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.
- sphinx/__init__.py +2 -2
- sphinx/_cli/__init__.py +4 -4
- sphinx/application.py +2 -2
- sphinx/builders/__init__.py +2 -3
- sphinx/builders/_epub_base.py +33 -12
- sphinx/builders/changes.py +13 -5
- sphinx/builders/epub3.py +6 -2
- sphinx/builders/html/__init__.py +90 -59
- sphinx/builders/latex/__init__.py +38 -12
- sphinx/builders/latex/transforms.py +1 -1
- sphinx/builders/linkcheck.py +8 -49
- sphinx/builders/texinfo.py +12 -6
- sphinx/builders/text.py +7 -3
- sphinx/builders/xml.py +7 -3
- sphinx/cmd/quickstart.py +10 -20
- sphinx/config.py +13 -13
- sphinx/deprecation.py +8 -8
- sphinx/directives/__init__.py +14 -9
- sphinx/directives/other.py +2 -3
- sphinx/directives/patches.py +2 -2
- sphinx/domains/__init__.py +4 -2
- sphinx/domains/c/__init__.py +2 -2
- sphinx/domains/c/_ast.py +3 -2
- sphinx/domains/c/_parser.py +4 -3
- sphinx/domains/cpp/__init__.py +2 -2
- sphinx/domains/cpp/_ast.py +1 -2
- sphinx/domains/cpp/_parser.py +2 -2
- sphinx/domains/cpp/_symbol.py +2 -2
- sphinx/domains/javascript.py +1 -1
- sphinx/domains/math.py +1 -1
- sphinx/domains/python/__init__.py +1 -1
- sphinx/domains/python/_annotations.py +23 -1
- sphinx/domains/python/_object.py +0 -1
- sphinx/domains/std/__init__.py +7 -8
- sphinx/environment/__init__.py +15 -32
- sphinx/environment/adapters/indexentries.py +4 -6
- sphinx/environment/adapters/toctree.py +4 -4
- sphinx/environment/collectors/title.py +1 -1
- sphinx/environment/collectors/toctree.py +1 -1
- sphinx/events.py +3 -1
- sphinx/ext/autodoc/__init__.py +25 -67
- sphinx/ext/autodoc/directive.py +7 -5
- sphinx/ext/autodoc/importer.py +2 -1
- sphinx/ext/autodoc/preserve_defaults.py +2 -2
- sphinx/ext/autosummary/__init__.py +15 -7
- sphinx/ext/autosummary/generate.py +5 -4
- sphinx/ext/doctest.py +5 -5
- sphinx/ext/graphviz.py +1 -1
- sphinx/ext/imgmath.py +1 -1
- sphinx/ext/inheritance_diagram.py +1 -1
- sphinx/ext/intersphinx/__init__.py +25 -5
- sphinx/ext/intersphinx/_cli.py +7 -6
- sphinx/ext/intersphinx/_load.py +240 -115
- sphinx/ext/intersphinx/_resolve.py +12 -11
- sphinx/ext/intersphinx/_shared.py +102 -9
- sphinx/ext/mathjax.py +1 -1
- sphinx/ext/napoleon/docstring.py +2 -2
- sphinx/ext/todo.py +2 -2
- sphinx/ext/viewcode.py +2 -1
- sphinx/highlighting.py +3 -3
- sphinx/io.py +2 -2
- sphinx/jinja2glue.py +13 -6
- sphinx/locale/__init__.py +4 -3
- sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ar/LC_MESSAGES/sphinx.po +2383 -2186
- sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bg/LC_MESSAGES/sphinx.po +2249 -2052
- sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/bn/LC_MESSAGES/sphinx.po +2412 -2215
- sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ca/LC_MESSAGES/sphinx.po +3029 -2832
- sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cak/LC_MESSAGES/sphinx.po +2308 -2111
- sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cs/LC_MESSAGES/sphinx.po +2469 -2272
- sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/cy/LC_MESSAGES/sphinx.po +2393 -2196
- sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/da/LC_MESSAGES/sphinx.po +2532 -2335
- sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de/LC_MESSAGES/sphinx.po +2492 -2295
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/el/LC_MESSAGES/sphinx.po +2879 -2682
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +2989 -2792
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eo/LC_MESSAGES/sphinx.po +2297 -2100
- sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es/LC_MESSAGES/sphinx.po +3017 -2820
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/et/LC_MESSAGES/sphinx.po +2748 -2551
- sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/eu/LC_MESSAGES/sphinx.po +2459 -2262
- sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fa/LC_MESSAGES/sphinx.po +2957 -2760
- sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fi/LC_MESSAGES/sphinx.po +2321 -2124
- sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr/LC_MESSAGES/sphinx.po +2977 -2780
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/gl/LC_MESSAGES/sphinx.po +2992 -2795
- sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/he/LC_MESSAGES/sphinx.po +2375 -2178
- sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi/LC_MESSAGES/sphinx.po +2937 -2740
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hr/LC_MESSAGES/sphinx.po +2532 -2335
- sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/hu/LC_MESSAGES/sphinx.po +2505 -2308
- sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/id/LC_MESSAGES/sphinx.po +2925 -2728
- sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/is/LC_MESSAGES/sphinx.po +2307 -2110
- sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/it/LC_MESSAGES/sphinx.po +2514 -2317
- sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ja/LC_MESSAGES/sphinx.po +2970 -2773
- sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ka/LC_MESSAGES/sphinx.po +2868 -2671
- sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ko/LC_MESSAGES/sphinx.po +3016 -2819
- sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lt/LC_MESSAGES/sphinx.po +2476 -2279
- sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/lv/LC_MESSAGES/sphinx.po +2477 -2280
- sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/mk/LC_MESSAGES/sphinx.po +2292 -2095
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +2479 -2282
- sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ne/LC_MESSAGES/sphinx.po +2481 -2284
- sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/nl/LC_MESSAGES/sphinx.po +2557 -2360
- sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pl/LC_MESSAGES/sphinx.po +2696 -2499
- sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +2979 -2782
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +2469 -2272
- sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ro/LC_MESSAGES/sphinx.po +2473 -2276
- sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ru/LC_MESSAGES/sphinx.po +2746 -2549
- sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/si/LC_MESSAGES/sphinx.po +2331 -2134
- sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sk/LC_MESSAGES/sphinx.po +2966 -2769
- sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sl/LC_MESSAGES/sphinx.po +2404 -2207
- sphinx/locale/sphinx.pot +2262 -2065
- sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sq/LC_MESSAGES/sphinx.po +2972 -2775
- sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sr/LC_MESSAGES/sphinx.po +2440 -2243
- sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/sv/LC_MESSAGES/sphinx.po +2483 -2286
- 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/te/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/te/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/tr/LC_MESSAGES/sphinx.po +2892 -2695
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +2400 -2203
- sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/ur/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/vi/LC_MESSAGES/sphinx.po +2422 -2225
- sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/yue/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +496 -704
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +3028 -2831
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
- sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +2250 -2053
- sphinx/project.py +25 -20
- sphinx/pycode/ast.py +2 -2
- sphinx/pycode/parser.py +2 -2
- sphinx/pygments_styles.py +3 -3
- sphinx/registry.py +3 -8
- sphinx/search/__init__.py +1 -1
- sphinx/testing/path.py +2 -1
- sphinx/testing/util.py +1 -1
- sphinx/texinputs/Makefile.jinja +2 -1
- sphinx/texinputs_win/Makefile.jinja +2 -1
- sphinx/theming.py +3 -12
- sphinx/transforms/__init__.py +5 -5
- sphinx/transforms/references.py +1 -1
- sphinx/util/__init__.py +11 -35
- sphinx/util/_pathlib.py +31 -19
- sphinx/util/_timestamps.py +12 -0
- sphinx/util/cfamily.py +5 -5
- sphinx/util/console.py +4 -3
- sphinx/util/display.py +3 -3
- sphinx/util/docfields.py +1 -1
- sphinx/util/docutils.py +44 -10
- sphinx/util/fileutil.py +41 -9
- sphinx/util/i18n.py +9 -4
- sphinx/util/images.py +3 -2
- sphinx/util/inspect.py +29 -44
- sphinx/util/inventory.py +2 -2
- sphinx/util/matching.py +2 -2
- sphinx/util/math.py +1 -1
- sphinx/util/nodes.py +8 -8
- sphinx/util/osutil.py +52 -26
- sphinx/util/parallel.py +2 -2
- sphinx/util/requests.py +1 -1
- sphinx/util/template.py +3 -3
- sphinx/util/typing.py +67 -70
- sphinx/writers/html.py +1 -1
- sphinx/writers/html5.py +1 -1
- sphinx/writers/latex.py +4 -4
- sphinx/writers/manpage.py +2 -2
- sphinx/writers/texinfo.py +5 -5
- sphinx/writers/text.py +4 -4
- sphinx/writers/xml.py +2 -2
- {sphinx-7.4.6.dist-info → sphinx-8.0.0.dist-info}/METADATA +11 -10
- {sphinx-7.4.6.dist-info → sphinx-8.0.0.dist-info}/RECORD +240 -241
- sphinx/templates/quickstart/Makefile.jinja +0 -98
- sphinx/templates/quickstart/make.bat.jinja +0 -110
- {sphinx-7.4.6.dist-info → sphinx-8.0.0.dist-info}/LICENSE.rst +0 -0
- {sphinx-7.4.6.dist-info → sphinx-8.0.0.dist-info}/WHEEL +0 -0
- {sphinx-7.4.6.dist-info → sphinx-8.0.0.dist-info}/entry_points.txt +0 -0
sphinx/ext/napoleon/docstring.py
CHANGED
|
@@ -8,14 +8,14 @@ import inspect
|
|
|
8
8
|
import re
|
|
9
9
|
from functools import partial
|
|
10
10
|
from itertools import starmap
|
|
11
|
-
from typing import TYPE_CHECKING, Any
|
|
11
|
+
from typing import TYPE_CHECKING, Any
|
|
12
12
|
|
|
13
13
|
from sphinx.locale import _, __
|
|
14
14
|
from sphinx.util import logging
|
|
15
15
|
from sphinx.util.typing import get_type_hints, stringify_annotation
|
|
16
16
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
|
-
from collections.abc import Iterator
|
|
18
|
+
from collections.abc import Callable, Iterator
|
|
19
19
|
|
|
20
20
|
from sphinx.application import Sphinx
|
|
21
21
|
from sphinx.config import Config as SphinxConfig
|
sphinx/ext/todo.py
CHANGED
|
@@ -29,7 +29,7 @@ if TYPE_CHECKING:
|
|
|
29
29
|
from sphinx.application import Sphinx
|
|
30
30
|
from sphinx.environment import BuildEnvironment
|
|
31
31
|
from sphinx.util.typing import ExtensionMetadata, OptionSpec
|
|
32
|
-
from sphinx.writers.
|
|
32
|
+
from sphinx.writers.html5 import HTML5Translator
|
|
33
33
|
from sphinx.writers.latex import LaTeXTranslator
|
|
34
34
|
|
|
35
35
|
logger = logging.getLogger(__name__)
|
|
@@ -43,7 +43,7 @@ class todolist(nodes.General, nodes.Element):
|
|
|
43
43
|
pass
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
class Todo(BaseAdmonition, SphinxDirective):
|
|
46
|
+
class Todo(BaseAdmonition, SphinxDirective): # type: ignore[misc]
|
|
47
47
|
"""
|
|
48
48
|
A todo entry, displayed (if configured) in the form of an admonition.
|
|
49
49
|
"""
|
sphinx/ext/viewcode.py
CHANGED
|
@@ -21,6 +21,7 @@ from sphinx.transforms.post_transforms import SphinxPostTransform
|
|
|
21
21
|
from sphinx.util import logging
|
|
22
22
|
from sphinx.util.display import status_iterator
|
|
23
23
|
from sphinx.util.nodes import make_refnode
|
|
24
|
+
from sphinx.util.osutil import _last_modified_time
|
|
24
25
|
|
|
25
26
|
if TYPE_CHECKING:
|
|
26
27
|
from collections.abc import Iterable, Iterator
|
|
@@ -231,7 +232,7 @@ def should_generate_module_page(app: Sphinx, modname: str) -> bool:
|
|
|
231
232
|
page_filename = path.join(app.outdir, '_modules/', basename)
|
|
232
233
|
|
|
233
234
|
try:
|
|
234
|
-
if
|
|
235
|
+
if _last_modified_time(module_filename) <= _last_modified_time(page_filename):
|
|
235
236
|
# generation is not needed if the HTML page is newer than module file.
|
|
236
237
|
return False
|
|
237
238
|
except OSError:
|
sphinx/highlighting.py
CHANGED
|
@@ -86,8 +86,8 @@ _LATEX_ADD_STYLES = r"""
|
|
|
86
86
|
class PygmentsBridge:
|
|
87
87
|
# Set these attributes if you want to have different Pygments formatters
|
|
88
88
|
# than the default ones.
|
|
89
|
-
html_formatter = HtmlFormatter
|
|
90
|
-
latex_formatter = LatexFormatter
|
|
89
|
+
html_formatter = HtmlFormatter[str]
|
|
90
|
+
latex_formatter = LatexFormatter[str]
|
|
91
91
|
|
|
92
92
|
def __init__(
|
|
93
93
|
self, dest: str = 'html', stylename: str = 'sphinx', latex_engine: str | None = None
|
|
@@ -98,7 +98,7 @@ class PygmentsBridge:
|
|
|
98
98
|
style = self.get_style(stylename)
|
|
99
99
|
self.formatter_args: dict[str, Any] = {'style': style}
|
|
100
100
|
if dest == 'html':
|
|
101
|
-
self.formatter = self.html_formatter
|
|
101
|
+
self.formatter: type[Formatter[str]] = self.html_formatter
|
|
102
102
|
else:
|
|
103
103
|
self.formatter = self.latex_formatter
|
|
104
104
|
self.formatter_args['commandprefix'] = 'PYG'
|
sphinx/io.py
CHANGED
|
@@ -35,7 +35,7 @@ if TYPE_CHECKING:
|
|
|
35
35
|
logger = logging.getLogger(__name__)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
class SphinxBaseReader(standalone.Reader):
|
|
38
|
+
class SphinxBaseReader(standalone.Reader): # type: ignore[misc]
|
|
39
39
|
"""
|
|
40
40
|
A base class of readers for Sphinx.
|
|
41
41
|
|
|
@@ -143,7 +143,7 @@ class SphinxI18nReader(SphinxBaseReader):
|
|
|
143
143
|
self.transforms.remove(transform)
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
class SphinxDummyWriter(UnfilteredWriter):
|
|
146
|
+
class SphinxDummyWriter(UnfilteredWriter): # type: ignore[misc]
|
|
147
147
|
"""Dummy writer module used for generating doctree."""
|
|
148
148
|
|
|
149
149
|
supported = ('html',) # needed to keep "meta" nodes
|
sphinx/jinja2glue.py
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import os
|
|
5
6
|
from os import path
|
|
6
7
|
from pprint import pformat
|
|
7
|
-
from typing import TYPE_CHECKING, Any
|
|
8
|
+
from typing import TYPE_CHECKING, Any
|
|
8
9
|
|
|
9
10
|
from jinja2 import BaseLoader, FileSystemLoader, TemplateNotFound
|
|
10
11
|
from jinja2.sandbox import SandboxedEnvironment
|
|
@@ -12,10 +13,10 @@ from jinja2.utils import open_if_exists, pass_context
|
|
|
12
13
|
|
|
13
14
|
from sphinx.application import TemplateBridge
|
|
14
15
|
from sphinx.util import logging
|
|
15
|
-
from sphinx.util.osutil import
|
|
16
|
+
from sphinx.util.osutil import _last_modified_time
|
|
16
17
|
|
|
17
18
|
if TYPE_CHECKING:
|
|
18
|
-
from collections.abc import Iterator
|
|
19
|
+
from collections.abc import Callable, Iterator
|
|
19
20
|
|
|
20
21
|
from jinja2.environment import Environment
|
|
21
22
|
|
|
@@ -127,11 +128,11 @@ class SphinxFileSystemLoader(FileSystemLoader):
|
|
|
127
128
|
with f:
|
|
128
129
|
contents = f.read().decode(self.encoding)
|
|
129
130
|
|
|
130
|
-
mtime =
|
|
131
|
+
mtime = _last_modified_time(filename)
|
|
131
132
|
|
|
132
133
|
def uptodate() -> bool:
|
|
133
134
|
try:
|
|
134
|
-
return
|
|
135
|
+
return _last_modified_time(filename) == mtime
|
|
135
136
|
except OSError:
|
|
136
137
|
return False
|
|
137
138
|
|
|
@@ -203,7 +204,13 @@ class BuiltinTemplateLoader(TemplateBridge, BaseLoader):
|
|
|
203
204
|
return self.environment.from_string(source).render(context)
|
|
204
205
|
|
|
205
206
|
def newest_template_mtime(self) -> float:
|
|
206
|
-
return max(
|
|
207
|
+
return max(
|
|
208
|
+
os.stat(os.path.join(root, sfile)).st_mtime_ns / 10**9
|
|
209
|
+
for dirname in self.pathchain
|
|
210
|
+
for root, _dirs, files in os.walk(dirname)
|
|
211
|
+
for sfile in files
|
|
212
|
+
if sfile.endswith('.html')
|
|
213
|
+
)
|
|
207
214
|
|
|
208
215
|
# Loader interface
|
|
209
216
|
|
sphinx/locale/__init__.py
CHANGED
|
@@ -9,8 +9,9 @@ from os import path
|
|
|
9
9
|
from typing import TYPE_CHECKING
|
|
10
10
|
|
|
11
11
|
if TYPE_CHECKING:
|
|
12
|
-
|
|
13
|
-
from
|
|
12
|
+
import os
|
|
13
|
+
from collections.abc import Callable, Iterable
|
|
14
|
+
from typing import Any
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class _TranslationProxy:
|
|
@@ -98,7 +99,7 @@ translators: dict[tuple[str, str], NullTranslations] = {}
|
|
|
98
99
|
|
|
99
100
|
|
|
100
101
|
def init(
|
|
101
|
-
locale_dirs: Iterable[str | None],
|
|
102
|
+
locale_dirs: Iterable[str | os.PathLike[str] | None],
|
|
102
103
|
language: str | None,
|
|
103
104
|
catalog: str = 'sphinx',
|
|
104
105
|
namespace: str = 'general',
|
|
Binary file
|