Skip to content

Commit fb9a11e

Browse files
authored
Merge branch 'master' into autosummary-class
2 parents f950743 + df3d94f commit fb9a11e

File tree

176 files changed

+581
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+581
-216
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,4 @@ jobs:
342342
env:
343343
VIRTUALENV_SYSTEM_SITE_PACKAGES: "1"
344344
- name: codecov
345-
uses: codecov/codecov-action@v4
345+
uses: codecov/codecov-action@v5

.ruff.toml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ select = [
222222
# ruff-specific rules ('RUF')
223223
# "RUF001", # String contains ambiguous {}. Did you mean {}?
224224
"RUF002", # Docstring contains ambiguous {}. Did you mean {}?
225-
# "RUF003", # Comment contains ambiguous {}. Did you mean {}?
225+
"RUF003", # Comment contains ambiguous {}. Did you mean {}?
226226
"RUF005", # Consider `{expression}` instead of concatenation
227227
"RUF006", # Store a reference to the return value of `{expr}.{method}`
228228
"RUF007", # Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
@@ -231,7 +231,7 @@ select = [
231231
"RUF010", # Use explicit conversion flag
232232
# "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
233233
"RUF013", # PEP 484 prohibits implicit `Optional`
234-
# "RUF015", # Prefer `next({iterable})` over single element slice
234+
"RUF015", # Prefer `next({iterable})` over single element slice
235235
"RUF016", # Slice in indexed access to type `{value_type}` uses type `{index_type}` instead of an integer
236236
"RUF017", # Avoid quadratic list summation
237237
"RUF018", # Avoid assignment expressions in `assert` statements
@@ -243,13 +243,21 @@ select = [
243243
"RUF024", # Do not pass mutable objects as values to `dict.fromkeys`
244244
"RUF026", # `default_factory` is a positional-only argument to `defaultdict`
245245
# "RUF027", # Possible f-string without an `f` prefix
246-
# "RUF028", # This suppression comment is invalid because {}
247-
# "RUF029", # Function `{name}` is declared `async`, but doesn't `await` or use `async` features.
248-
"RUF030", # `print()` expression in `assert` statement is likely unintentional
249-
# "RUF031", # Use parentheses for tuples in subscripts.
246+
"RUF028", # This suppression comment is invalid because {}
247+
"RUF029", # Function `{name}` is declared `async`, but doesn't `await` or use `async` features.
248+
"RUF030", # `print()` call in `assert` statement is likely unintentional
249+
"RUF031", # Use parentheses for tuples in subscripts
250250
"RUF032", # `Decimal()` called with float literal argument
251251
"RUF033", # `__post_init__` method with argument defaults
252-
"RUF034", # Useless if-else condition
252+
"RUF034", # Useless `if`-`else` condition
253+
"RUF035", # Unsafe use of `{name}` detected
254+
"RUF036", # `None` not at the end of the type annotation.
255+
"RUF038", # `Literal[True, False, ...]` can be replaced with `Literal[...] | bool`
256+
# "RUF039", # First argument to {call} is not raw string
257+
"RUF040", # Non-string literal used as assert message
258+
"RUF041", # Unnecessary nested `Literal`
259+
# "RUF048", # `__version__` may contain non-integral-like elements
260+
"RUF055", # Plain string pattern passed to `re` function
253261
# "RUF100", # Unused `noqa` directive
254262
"RUF101", # `{original}` is a redirect to `{target}`
255263
"RUF200", # Failed to parse pyproject.toml: {message}
@@ -292,10 +300,10 @@ select = [
292300
[lint.per-file-ignores]
293301
"doc/*" = [
294302
"ANN", # documentation doesn't need annotations
295-
"TCH001", # documentation doesn't need type-checking blocks
303+
"TC001", # documentation doesn't need type-checking blocks
296304
]
297305
"doc/conf.py" = ["INP001", "W605"]
298-
"doc/development/tutorials/examples/*" = ["INP001"]
306+
"doc/development/tutorials/examples/*" = ["I002", "INP001"]
299307
# allow print() in the tutorial
300308
"doc/development/tutorials/examples/recipe.py" = [
301309
"FURB118",
@@ -359,8 +367,8 @@ select = [
359367
]
360368

361369
# these tests need old ``typing`` generic aliases
362-
"tests/test_util/test_util_typing.py" = ["UP006", "UP007", "UP035"]
363-
"tests/test_util/typing_test_data.py" = ["FA100", "PYI030", "UP006", "UP007", "UP035"]
370+
"tests/test_util/test_util_typing.py" = ["RUF036", "UP006", "UP007", "UP035"]
371+
"tests/test_util/typing_test_data.py" = ["FA100", "I002", "PYI030", "UP006", "UP007", "UP035"]
364372

365373
"utils/*" = [
366374
"T201", # whitelist ``print`` for stdout messages
@@ -377,6 +385,9 @@ inline-quotes = "single"
377385
forced-separate = [
378386
"tests",
379387
]
388+
required-imports = [
389+
"from __future__ import annotations",
390+
]
380391

381392
[format]
382393
preview = true

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ Bugs fixed
2626

2727
* #13060: HTML Search: use ``Map`` to store per-file term scores.
2828
Patch by James Addison
29+
* #13130: LaTeX docs: ``pdflatex`` index creation may fail for index entries
30+
in French. See :confval:`latex_use_xindy`.
31+
Patch by Jean-François B.
32+
* LaTeX: fix a ``7.4.0`` typo in a default for ``\sphinxboxsetup``
33+
(refs: PR #13152).
34+
Patch by Jean-François B.
2935

3036
Testing
3137
-------

doc/man/sphinx-build.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Options
141141
.. versionchanged:: 6.2
142142
Add ``--jobs`` long option.
143143

144-
.. option:: -c path, --config-dir path
144+
.. option:: -c path, --conf-dir path
145145

146146
Don't look for the :file:`conf.py` in the source directory, but use the given
147147
configuration directory instead. Note that various other files and paths
@@ -152,7 +152,7 @@ Options
152152
.. versionadded:: 0.3
153153

154154
.. versionchanged:: 7.3
155-
Add ``--config-dir`` long option.
155+
Add ``--conf-dir`` long option.
156156

157157
.. option:: -C, --isolated
158158

doc/usage/configuration.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,6 +3157,9 @@ These options influence LaTeX output.
31573157
* The default is :code-py:`False` for :code-py:`'pdflatex'`,
31583158
but :code-py:`True` is recommended for non-English documents as soon
31593159
as some indexed terms use non-ASCII characters from the language script.
3160+
Attempting to index a term whose first character is non-ASCII
3161+
will break the build, if :confval:`latex_use_xindy` is left to its
3162+
default :code-py:`False`.
31603163

31613164
Sphinx adds some dedicated support to the :program:`xindy` base distribution
31623165
for using :code-py:`'pdflatex'` engine with Cyrillic scripts.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ docs = [
8282
]
8383
lint = [
8484
"flake8>=6.0",
85-
"ruff==0.7.3",
85+
"ruff==0.8.1",
8686
"mypy==1.13.0",
8787
"sphinx-lint>=0.9",
8888
"types-colorama==0.4.15.20240311",
8989
"types-defusedxml==0.7.0.20240218",
90-
"types-docutils==0.21.0.20241005",
90+
"types-docutils==0.21.0.20241128",
9191
"types-Pillow==10.2.0.20240822",
9292
"types-Pygments==2.18.0.20240506",
9393
"types-requests==2.32.0.20241016", # align with requests

sphinx/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""The Sphinx documentation toolchain."""
22

3+
from __future__ import annotations
4+
35
__version__ = '8.2.0'
46
__display_version__ = __version__ # used for command line version
57

sphinx/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""The Sphinx documentation toolchain."""
22

3+
from __future__ import annotations
4+
35
import sys
46

57
from sphinx.cmd.build import main

sphinx/_cli/util/colour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import os
66
import sys
7-
from collections.abc import Callable # NoQA: TCH003
7+
from collections.abc import Callable # NoQA: TC003
88

99
if sys.platform == 'win32':
1010
import colorama

sphinx/application.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from sphinx.project import Project
2727
from sphinx.registry import SphinxComponentRegistry
2828
from sphinx.util import docutils, logging
29-
from sphinx.util._pathlib import _StrPath
29+
from sphinx.util._pathlib import _StrPath, _StrPathProperty
3030
from sphinx.util.build_phase import BuildPhase
3131
from sphinx.util.console import bold
3232
from sphinx.util.display import progress_message
@@ -140,6 +140,11 @@ class Sphinx:
140140
warningiserror: Final = False
141141
_warncount: int
142142

143+
srcdir = _StrPathProperty()
144+
confdir = _StrPathProperty()
145+
outdir = _StrPathProperty()
146+
doctreedir = _StrPathProperty()
147+
143148
def __init__(self, srcdir: str | os.PathLike[str], confdir: str | os.PathLike[str] | None,
144149
outdir: str | os.PathLike[str], doctreedir: str | os.PathLike[str],
145150
buildername: str, confoverrides: dict | None = None,

0 commit comments

Comments
 (0)