Skip to content

Commit d153238

Browse files
authored
Merge branch 'master' into dependabot/pip/pypi-attestations-0.0.27
2 parents a0b6f42 + 7522fb6 commit d153238

File tree

189 files changed

+7218
-5744
lines changed

Some content is hidden

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

189 files changed

+7218
-5744
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ tests/roots/test-pycode/cp_1251_coded.py dos
5151

5252
# Non UTF-8 encodings
5353
tests/roots/test-pycode/cp_1251_coded.py working-tree-encoding=windows-1251
54+
tests/roots/test-root/wrongenc.inc working-tree-encoding=latin-1
55+
tests/roots/test-warnings/wrongenc.inc working-tree-encoding=latin-1
5456

5557
# Generated files
5658
# https://github.com/github/linguist/blob/master/docs/overrides.md

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
matrix:
9090
python:
9191
- "3.14"
92+
- "3.15"
9293
docutils:
9394
- "0.20"
9495
- "0.21"
@@ -125,6 +126,7 @@ jobs:
125126
matrix:
126127
python:
127128
- "3.14"
129+
- "3.15"
128130

129131
steps:
130132
- uses: actions/checkout@v4

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Contributors
103103
* Stefan Seefeld -- toctree improvements
104104
* Stefan van der Walt -- autosummary extension
105105
* Steve Piercy -- documentation improvements
106+
* Szymon Karpinski -- intersphinx improvements
106107
* \T. Powers -- HTML output improvements
107108
* Taku Shimizu -- epub3 builder
108109
* Thomas Lamb -- linkcheck builder

CHANGES.rst

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,34 @@ Dependencies
77
Incompatible changes
88
--------------------
99

10+
* #13639: :py:meth:`!SphinxComponentRegistry.create_source_parser` no longer
11+
has an *app* parameter, instead taking *config* and *env*.
12+
Patch by Adam Turner.
13+
1014
Deprecated
1115
----------
1216

17+
* 13627: Deprecate remaining public :py:attr:`!.app` attributes,
18+
including ``builder.app``, ``env.app``, ``events.app``,
19+
and ``SphinxTransform.`app``.
20+
Patch by Adam Turner.
21+
* #13637: Deprecate the :py:meth:`!set_application` method
22+
of :py:class:`~sphinx.parsers.Parser` objects.
23+
Patch by Adam Turner.
24+
* #13644: Deprecate the :py:attr:`!Parser.config` and :py:attr:`!env` attributes.
25+
Patch by Adam Turner.
26+
* #13665: Deprecate support for non-UTF 8 source encodings,
27+
scheduled for removal in Sphinx 10.
28+
Patch by Adam Turner.
29+
* #13679: Non-decodable characters in source files will raise an error in Sphinx 9.
30+
Currently, such bytes are replaced with '?' along with logging a warning.
31+
Patch by Adam Turner.
32+
* #13682: Deprecate :py:mod:`!sphinx.io`.
33+
Sphinx no longer uses the :py:mod:`!sphinx.io` classes,
34+
having replaced them with standard Python I/O.
35+
The entire :py:mod:`!sphinx.io` module will be removed in Sphinx 10.
36+
Patch by Adam Turner.
37+
1338
Features added
1439
--------------
1540

@@ -22,21 +47,56 @@ Features added
2247
* #13497: Support C domain objects in the table of contents.
2348
* #13500: LaTeX: add support for ``fontawesome6`` package.
2449
Patch by Jean-François B.
25-
* #13535: html search: Update to the latest version of Snowball (v3.0.1).
26-
Patch by Adam Turner.
27-
* #13704: autodoc: Detect :py:func:`typing_extensions.overload <typing.overload>`
50+
* #13509: autodoc: Detect :py:func:`typing_extensions.overload <typing.overload>`
2851
and :py:func:`~typing.final` decorators.
2952
Patch by Spencer Brown.
53+
* #13535: html search: Update to the latest version of Snowball (v3.0.1).
54+
Patch by Adam Turner.
55+
* #13647: LaTeX: allow more cases of table nesting.
56+
Patch by Jean-François B.
57+
* #13684: intersphinx: Add a file-based cache for remote inventories.
58+
The location of the cache directory must not be relied upon externally,
59+
as it may change without notice or warning in future releases.
60+
Patch by Adam Turner.
3061

3162
Bugs fixed
3263
----------
3364

65+
* #1327: LaTeX: tables using longtable raise error if
66+
:rst:dir:`tabularcolumns` specifies automatic widths
67+
(``L``, ``R``, ``C``, or ``J``).
68+
Patch by Jean-François B.
69+
* #3447: LaTeX: when assigning longtable class to table for PDF, it may render
70+
"horizontally" and overflow in right margin.
71+
Patch by Jean-François B.
72+
* #8828: LaTeX: adding a footnote to a longtable cell causes table to occupy
73+
full width.
74+
Patch by Jean-François B.
75+
* #11498: LaTeX: Table in cell fails to build if it has many rows.
76+
Patch by Jean-François B.
77+
* #11515: LaTeX: longtable does not allow nested table.
78+
Patch by Jean-François B.
79+
* #11973: LaTeX: links in table captions do not work in PDF.
80+
Patch by Jean-François B.
3481
* #12821: LaTeX: URLs/links in section titles should render in PDF.
3582
Patch by Jean-François B.
3683
* #13369: Correctly parse and cross-reference unpacked type annotations.
3784
Patch by Alicia Garcia-Raboso.
3885
* #13528: Add tilde ``~`` prefix support for :rst:role:`py:deco`.
3986
Patch by Shengyu Zhang and Adam Turner.
87+
* #13597: LaTeX: table nested in a merged cell leads to invalid LaTeX mark-up
88+
and PDF cannot be built.
89+
Patch by Jean-François B.
90+
* #13619: LaTeX: possible duplicated footnotes in PDF from object signatures
91+
(typically if :confval:`latex_show_urls` ``= 'footnote'``).
92+
Patch by Jean-François B.
93+
* #13635: LaTeX: if a cell contains a table, row coloring is turned off for
94+
the next table cells.
95+
Patch by Jean-François B.
96+
* #13685: gettext: Correctly ignore trailing backslashes.
97+
Patch by Bénédikt Tran.
98+
* #13712: intersphinx: Don't add "v" prefix to non-numeric versions.
99+
Patch by Szymon Karpinski.
40100

41101
Testing
42102
-------

doc/changes/5.3.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ Release 5.3.0 (released Oct 16, 2022)
88

99
* #10759: LaTeX: add :confval:`latex_table_style` and support the
1010
``'booktabs'``, ``'borderless'``, and ``'colorrows'`` styles.
11-
(thanks to Stefan Wiehler for initial pull requests #6666, #6671)
11+
(thanks to Stefan Wiehler for initial pull requests #6666, #6671).
12+
Using the ``'booktabs'`` style solves #6740 (Removing LaTeX
13+
column borders for automatic colspec).
14+
Patch by Jean-François B.
1215
* #10840: One can cross-reference including an option value like
1316
``:option:`--module=foobar```, ``:option:`--module[=foobar]```,
1417
or ``:option:`--module foobar```.

doc/conf.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,12 @@ def linkify_issues_in_changelog(
297297
) -> None:
298298
"""Linkify issue references like #123 in changelog to GitHub."""
299299
if docname == 'changes':
300+
linkified_changelog = re.sub(r'(?:PR)?#([0-9]+)\b', _linkify, source[0])
301+
source[0] = linkified_changelog
300302

301-
def linkify(match: re.Match[str]) -> str:
302-
url = 'https://github.com/sphinx-doc/sphinx/issues/' + match[1]
303-
return f'`{match[0]} <{url}>`_'
304-
305-
linkified_changelog = re.sub(r'(?:PR)?#([0-9]+)\b', linkify, source[0])
306303

307-
source[0] = linkified_changelog
304+
def _linkify(match: re.Match[str], /) -> str:
305+
return f'`{match[0]} <https://github.com/sphinx-doc/sphinx/issues/{match[1]}>`__'
308306

309307

310308
REDIRECT_TEMPLATE = """

doc/development/tutorials/examples/recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def add_recipe(self, signature, ingredients):
165165
name,
166166
signature,
167167
'Recipe',
168-
self.env.docname,
168+
self.env.current_document.docname,
169169
anchor,
170170
0,
171171
))

doc/development/tutorials/examples/todo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def run(self):
4444
self.env.todo_all_todos = []
4545

4646
self.env.todo_all_todos.append({
47-
'docname': self.env.docname,
47+
'docname': self.env.current_document.docname,
4848
'lineno': self.lineno,
4949
'todo': todo_node.deepcopy(),
5050
'target': targetnode,

doc/development/tutorials/extending_build.rst

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Looking first at the ``TodolistDirective`` directive:
143143
.. literalinclude:: examples/todo.py
144144
:language: python
145145
:linenos:
146-
:lines: 24-27
146+
:pyobject: TodolistDirective
147147

148148
It's very simple, creating and returning an instance of our ``todolist`` node
149149
class. The ``TodolistDirective`` directive itself has neither content nor
@@ -153,7 +153,7 @@ directive:
153153
.. literalinclude:: examples/todo.py
154154
:language: python
155155
:linenos:
156-
:lines: 30-53
156+
:pyobject: TodoDirective
157157

158158
Several important things are covered here. First, as you can see, we're now
159159
subclassing the :class:`~sphinx.util.docutils.SphinxDirective` helper class
@@ -168,16 +168,16 @@ new unique integer on each call and therefore leads to unique target names. The
168168
target node is instantiated without any text (the first two arguments).
169169

170170
On creating admonition node, the content body of the directive are parsed using
171-
``self.state.nested_parse``. The first argument gives the content body, and
172-
the second one gives content offset. The third argument gives the parent node
173-
of parsed result, in our case the ``todo`` node. Following this, the ``todo``
174-
node is added to the environment. This is needed to be able to create a list of
175-
all todo entries throughout the documentation, in the place where the author
176-
puts a ``todolist`` directive. For this case, the environment attribute
177-
``todo_all_todos`` is used (again, the name should be unique, so it is prefixed
178-
by the extension name). It does not exist when a new environment is created, so
179-
the directive must check and create it if necessary. Various information about
180-
the todo entry's location are stored along with a copy of the node.
171+
``self.parse_content_to_nodes()``.
172+
Following this, the ``todo`` node is added to the environment.
173+
This is needed to be able to create a list of all todo entries throughout
174+
the documentation, in the place where the author puts a ``todolist`` directive.
175+
For this case, the environment attribute ``todo_all_todos`` is used
176+
(again, the name should be unique, so it is prefixed by the extension name).
177+
It does not exist when a new environment is created, so the directive must
178+
check and create it if necessary.
179+
Various information about the todo entry's location are stored along with
180+
a copy of the node.
181181

182182
In the last line, the nodes that should be put into the doctree are returned:
183183
the target node and the admonition node.
@@ -211,7 +211,7 @@ the :event:`env-purge-doc` event:
211211
.. literalinclude:: examples/todo.py
212212
:language: python
213213
:linenos:
214-
:lines: 56-61
214+
:pyobject: purge_todos
215215

216216
Since we store information from source files in the environment, which is
217217
persistent, it may become out of date when the source file changes. Therefore,
@@ -229,20 +229,21 @@ to be merged:
229229
.. literalinclude:: examples/todo.py
230230
:language: python
231231
:linenos:
232-
:lines: 64-68
232+
:pyobject: merge_todos
233233

234234

235235
The other handler belongs to the :event:`doctree-resolved` event:
236236

237237
.. literalinclude:: examples/todo.py
238238
:language: python
239239
:linenos:
240-
:lines: 71-113
240+
:pyobject: process_todo_nodes
241241

242-
The :event:`doctree-resolved` event is emitted at the end of :ref:`phase 3
243-
(resolving) <build-phases>` and allows custom resolving to be done. The handler
244-
we have written for this event is a bit more involved. If the
245-
``todo_include_todos`` config value (which we'll describe shortly) is false,
242+
The :event:`doctree-resolved` event is emitted for each document that is
243+
about to be written at the end of :ref:`phase 3 (resolving) <build-phases>`
244+
and allows custom resolving to be done on that document.
245+
The handler we have written for this event is a bit more involved.
246+
If the ``todo_include_todos`` config value (which we'll describe shortly) is false,
246247
all ``todo`` and ``todolist`` nodes are removed from the documents. If not,
247248
``todo`` nodes just stay where and how they are. ``todolist`` nodes are
248249
replaced by a list of todo entries, complete with backlinks to the location
@@ -266,17 +267,17 @@ the other parts of our extension. Let's look at our ``setup`` function:
266267
.. literalinclude:: examples/todo.py
267268
:language: python
268269
:linenos:
269-
:lines: 116-
270+
:pyobject: setup
270271

271272
The calls in this function refer to the classes and functions we added earlier.
272273
What the individual calls do is the following:
273274

274275
* :meth:`~Sphinx.add_config_value` lets Sphinx know that it should recognize the
275-
new *config value* ``todo_include_todos``, whose default value should be
276-
``False`` (this also tells Sphinx that it is a boolean value).
276+
new *config value* ``todo_include_todos``, whose default value is ``False``
277+
(which also tells Sphinx that it is a boolean value).
277278

278-
If the third argument was ``'html'``, HTML documents would be full rebuild if the
279-
config value changed its value. This is needed for config values that
279+
If the third argument was ``'html'``, HTML documents would be fully rebuilt
280+
if the config value changed its value. This is needed for config values that
280281
influence reading (build :ref:`phase 1 (reading) <build-phases>`).
281282

282283
* :meth:`~Sphinx.add_node` adds a new *node class* to the build system. It also

doc/extdev/deprecated.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,36 @@ The following is a list of deprecated interfaces.
2222
- Removed
2323
- Alternatives
2424

25+
* - ``sphinx.io`` (entire module)
26+
- 8.3
27+
- 10.0
28+
- ``docutils.io`` or standard Python I/O
29+
30+
* - ``sphinx.builders.Builder.app``
31+
- 8.3
32+
- 10.0
33+
- N/A
34+
35+
* - ``sphinx.environment.BuildEnvironment.app``
36+
- 8.3
37+
- 10.0
38+
- N/A
39+
40+
* - ``sphinx.transforms.Transform.app``
41+
- 8.3
42+
- 10.0
43+
- N/A
44+
45+
* - ``sphinx.transforms.post_transforms.SphinxPostTransform.app``
46+
- 8.3
47+
- 10.0
48+
- N/A
49+
50+
* - ``sphinx.events.EventManager.app``
51+
- 8.3
52+
- 10.0
53+
- N/A
54+
2555
* - ``sphinx.builders.singlehtml.SingleFileHTMLBuilder.fix_refuris``
2656
- 8.2
2757
- 10.0

0 commit comments

Comments
 (0)