Skip to content

Commit c453288

Browse files
committed
Merge branch 'autodoc-auto' of https://github.com/chrisjsewell/sphinx into autodoc-auto
2 parents 1183d39 + 3e88195 commit c453288

File tree

176 files changed

+1649
-1065
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

+1649
-1065
lines changed

.github/workflows/create-release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ jobs:
7373

7474
- name: Inspect PEP 740 attestations
7575
run: |
76+
# resolution fails without betterproto and protobuf-specs
77+
uv pip install "pypi-attestations==0.0.12" "sigstore-protobuf-specs==0.3.2" "betterproto==2.0.0b6"
7678
python -m pypi_attestations inspect dist/*.publish.attestation
7779
7880
- name: Prepare attestation bundles for uploading

AUTHORS.rst

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Contributors
2828
* Antonio Valentino -- qthelp builder, docstring inheritance
2929
* Antti Kaihola -- doctest extension (skipif option)
3030
* Barry Warsaw -- setup command improvements
31+
* Bart Kamphorst -- warning improvements
3132
* Ben Egan -- Napoleon improvements & viewcode improvements
3233
* Benjamin Peterson -- unittests
3334
* Blaise Laflamme -- pyramid theme

CHANGES.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Incompatible changes
1010
--------------------
1111

1212
* #13044: Remove the internal and undocumented ``has_equations`` data
13-
from the :py:class:`!MathDomain`` domain.
13+
from the :py:class:`!MathDomain` domain.
1414
The undocumented :py:meth:`!MathDomain.has_equations` method
1515
now unconditionally returns ``True``.
1616
These are replaced by the ``has_maths_elements`` key of the page context dict.
@@ -62,10 +62,8 @@ Features added
6262
:confval:`python_trailing_comma_in_multi_line_signatures` and
6363
:confval:`javascript_trailing_comma_in_multi_line_signatures`
6464
configuration options.
65-
* #13264: Rename the :rst:dir:`math` directive's ``nowrap``option
66-
to :rst:dir:`no-wrap``,
67-
and rename the :rst:dir:`autosummary` directive's ``nosignatures``option
68-
to :rst:dir:`no-signatures``.
65+
* #13264: Rename the :rst:dir:`math` directive's ``nowrap`` option
66+
to :rst:dir:`math:no-wrap`.
6967
Patch by Adam Turner.
7068
* #13269: Added the option to disable the use of type comments in
7169
via the new :confval:`autodoc_use_type_comments` option,
@@ -115,6 +113,8 @@ Features added
115113
to automate API documentation generation
116114
from Python modules.
117115
Patch by Chris Sewell and Adam Turner.
116+
* #13335: Use ``misc.highlighting_failure`` subtype for Pygments unknown lexers.
117+
Patch by Bart Kamphorst.
118118

119119
Bugs fixed
120120
----------
@@ -155,6 +155,8 @@ Bugs fixed
155155
* #13302, #13319: Use the correct indentation for continuation lines
156156
in :rst:dir:`productionlist` directives.
157157
Patch by Adam Turner.
158+
* #13328: Fix parsing of PEP 695 functions with return annotations.
159+
Patch by Bénédikt Tran. Initial work by Arash Badie-Modiri.
158160

159161
Testing
160162
-------

doc/internals/contributing.rst

+6-10
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,7 @@ These are the basic steps needed to start developing on Sphinx.
121121

122122
.. code-block:: shell
123123
124-
git commit -m '#42: Add useful new feature that does this.'
125-
126-
GitHub recognizes certain phrases that can be used to automatically
127-
update the issue tracker. For example:
128-
129-
.. code-block:: shell
130-
131-
git commit -m 'Closes #42: Fix invalid markup in docstring of Foo.bar.'
132-
133-
would close issue #42.
124+
git commit -m 'Add useful new feature that does this.'
134125
135126
#. Push changes in the branch to your forked repository on GitHub:
136127

@@ -140,6 +131,11 @@ These are the basic steps needed to start developing on Sphinx.
140131
141132
#. Submit a pull request from your branch to the ``master`` branch.
142133

134+
GitHub recognizes certain phrases that can be used to automatically
135+
update the issue tracker.
136+
For example, including 'Closes #42' in the body of your pull request
137+
will close issue #42 if the PR is merged.
138+
143139
#. Wait for a core developer or contributor to review your changes.
144140

145141

pyproject.toml

+15-49
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ classifiers = [
2424
"Intended Audience :: Developers",
2525
"Intended Audience :: Education",
2626
"Intended Audience :: End Users/Desktop",
27+
"Intended Audience :: Information Technology",
28+
"Intended Audience :: Other Audience",
2729
"Intended Audience :: Science/Research",
2830
"Intended Audience :: System Administrators",
2931
"License :: OSI Approved :: BSD License",
@@ -43,17 +45,24 @@ classifiers = [
4345
"Framework :: Sphinx :: Theme",
4446
"Topic :: Documentation",
4547
"Topic :: Documentation :: Sphinx",
48+
"Topic :: Education",
4649
"Topic :: Internet :: WWW/HTTP :: Site Management",
50+
"Topic :: Internet :: WWW/HTTP :: Site Management :: Link Checking",
4751
"Topic :: Printing",
4852
"Topic :: Software Development",
4953
"Topic :: Software Development :: Documentation",
54+
"Topic :: Text Editors :: Documentation",
5055
"Topic :: Text Processing",
5156
"Topic :: Text Processing :: General",
5257
"Topic :: Text Processing :: Indexing",
5358
"Topic :: Text Processing :: Markup",
5459
"Topic :: Text Processing :: Markup :: HTML",
5560
"Topic :: Text Processing :: Markup :: LaTeX",
61+
"Topic :: Text Processing :: Markup :: Markdown",
62+
"Topic :: Text Processing :: Markup :: reStructuredText",
63+
"Topic :: Text Processing :: Markup :: XML",
5664
"Topic :: Utilities",
65+
"Typing :: Typed",
5766
]
5867
dependencies = [
5968
"sphinxcontrib-applehelp>=1.0.7",
@@ -91,8 +100,8 @@ lint = [
91100
"types-Pygments==2.19.0.20250107",
92101
"types-requests==2.32.0.20241016", # align with requests
93102
"types-urllib3==1.26.25.14",
94-
"pyright==1.1.393",
95-
"pytest>=6.0",
103+
"pyright==1.1.394",
104+
"pytest>=8.0",
96105
]
97106
test = [
98107
"pytest>=8.0",
@@ -103,6 +112,10 @@ test = [
103112
"typing_extensions>=4.9", # for typing_extensions.Unpack
104113
]
105114

115+
[[project.authors]]
116+
name = "Adam Turner"
117+
118+
106119
[[project.authors]]
107120
name = "Georg Brandl"
108121
@@ -191,101 +204,57 @@ ignore_missing_imports = true
191204
module = [
192205
# tests/
193206
"tests.conftest",
194-
"tests.test_abc",
195207
"tests.test_addnodes",
196208
"tests.test_application",
197-
"tests.test_errors",
198209
"tests.test_events",
199210
"tests.test_highlighting",
200211
"tests.test_project",
201-
"tests.test_roles",
202212
"tests.test_versioning",
203213
# tests/test_builders
204214
"tests.test_builders.test_build",
205-
"tests.test_builders.test_build_changes",
206-
"tests.test_builders.test_build_dirhtml",
207215
"tests.test_builders.test_build_html",
208216
"tests.test_builders.test_build_html_5_output",
209217
"tests.test_builders.test_build_html_assets",
210-
"tests.test_builders.test_build_html_code",
211-
"tests.test_builders.test_build_html_download",
212-
"tests.test_builders.test_build_html_highlight",
213-
"tests.test_builders.test_build_html_image",
214218
"tests.test_builders.test_build_html_maths",
215219
"tests.test_builders.test_build_html_numfig",
216220
"tests.test_builders.test_build_html_tocdepth",
217221
"tests.test_builders.test_build_html_toctree",
218222
"tests.test_builders.test_build_linkcheck",
219-
"tests.test_builders.test_build_manpage",
220-
"tests.test_builders.test_build_text",
221223
"tests.test_builders.test_build_warnings",
222-
"tests.test_builders.test_incremental_reading",
223224
# tests/test_directives
224225
"tests.test_directives.test_directive_code",
225-
"tests.test_directives.test_directive_object_description",
226-
"tests.test_directives.test_directive_option",
227226
"tests.test_directives.test_directives_no_typesetting",
228-
# tests/test_domains
229-
"tests.test_domains.test_domain_py_canonical",
230227
# tests/test_environment
231228
"tests.test_environment.test_environment",
232-
"tests.test_environment.test_environment_indexentries",
233-
"tests.test_environment.test_environment_record_dependencies",
234229
# tests/test_extensions
235-
"tests.test_extensions.test_ext_autodoc_autoattribute",
236230
"tests.test_extensions.test_ext_autodoc_autoclass",
237-
"tests.test_extensions.test_ext_autodoc_autofunction",
238-
"tests.test_extensions.test_ext_autodoc_automodule",
239-
"tests.test_extensions.test_ext_autodoc_autoproperty",
240-
"tests.test_extensions.test_ext_autodoc_configs",
241-
"tests.test_extensions.test_ext_autodoc_preserve_defaults",
242-
"tests.test_extensions.test_ext_autodoc_private_members",
243-
"tests.test_extensions.test_ext_autosectionlabel",
244231
"tests.test_extensions.test_ext_autosummary_imports",
245-
"tests.test_extensions.test_ext_coverage",
246-
"tests.test_extensions.test_ext_duration",
247-
"tests.test_extensions.test_ext_extlinks",
248-
"tests.test_extensions.test_ext_graphviz",
249-
"tests.test_extensions.test_ext_ifconfig",
250232
"tests.test_extensions.test_ext_imgconverter",
251-
"tests.test_extensions.test_ext_imgmockconverter",
252233
"tests.test_extensions.test_ext_intersphinx_cache",
253234
"tests.test_extensions.test_ext_math",
254235
"tests.test_extensions.test_ext_napoleon",
255236
"tests.test_extensions.test_ext_todo",
256237
"tests.test_extensions.test_ext_viewcode",
257-
"tests.test_extensions.test_extension",
258238
# tests/test_intl
259239
"tests.test_intl.test_catalogs",
260240
"tests.test_intl.test_locale",
261241
# tests/test_markup
262242
"tests.test_markup.test_markup",
263-
"tests.test_markup.test_metadata",
264243
"tests.test_markup.test_parser",
265-
"tests.test_markup.test_smartquotes",
266-
# tests/test_pycode
267-
"tests.test_pycode.test_pycode_parser",
268244
# tests/test_theming
269-
"tests.test_theming.test_html_theme",
270245
"tests.test_theming.test_templating",
271246
"tests.test_theming.test_theming",
272247
# tests/test_transforms
273248
"tests.test_transforms.test_transforms_move_module_targets",
274-
"tests.test_transforms.test_transforms_post_transforms_code",
275249
"tests.test_transforms.test_transforms_post_transforms_images",
276250
"tests.test_transforms.test_transforms_reorder_nodes",
277251
# tests/test_util
278252
"tests.test_util.test_util",
279253
"tests.test_util.test_util_display",
280-
"tests.test_util.test_util_docstrings",
281254
"tests.test_util.test_util_docutils",
282-
"tests.test_util.test_util_docutils_sphinx_directive",
283255
"tests.test_util.test_util_images",
284-
"tests.test_util.test_util_importer",
285256
"tests.test_util.test_util_inventory",
286-
"tests.test_util.test_util_lines",
287257
"tests.test_util.test_util_matching",
288-
"tests.test_util.test_util_uri",
289258
# tests/test_writers
290259
"tests.test_writers.test_docutilsconf",
291260
]
@@ -298,7 +267,6 @@ module = [
298267
"tests.test_search",
299268
# tests/test_builders
300269
"tests.test_builders.test_build_latex",
301-
"tests.test_builders.test_build_texinfo",
302270
# tests/test_config
303271
"tests.test_config.test_config",
304272
# tests/test_directives
@@ -340,8 +308,6 @@ module = [
340308
"tests.test_util.test_util_inspect",
341309
"tests.test_util.test_util_logging",
342310
"tests.test_util.test_util_nodes",
343-
"tests.test_util.test_util_rst",
344-
"tests.test_util.test_util_template",
345311
"tests.test_util.test_util_typing",
346312
]
347313
check_untyped_defs = false

sphinx/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#:
3535
#: .. versionadded:: 1.2
3636
#: Before version 1.2, check the string ``sphinx.__version__``.
37-
version_info = (8, 2, 0, 'beta', 0)
37+
version_info = (8, 2, 0, 'candidate', 2)
3838

3939
package_dir = _StrPath(__file__).resolve().parent
4040

sphinx/addnodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class index(nodes.Invisible, nodes.Inline, nodes.TextElement):
436436
437437
*key* is categorization characters (usually a single character) for
438438
general index page. For the details of this, please see also:
439-
:rst:dir:`glossary` and issue #2320.
439+
:rst:dir:`glossary` and https://github.com/sphinx-doc/sphinx/pull/2320.
440440
"""
441441

442442

sphinx/builders/__init__.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
if TYPE_CHECKING:
4949
from collections.abc import Iterable, Sequence, Set
50+
from gettext import NullTranslations
5051
from typing import Any, Literal
5152

5253
from docutils.nodes import Node
@@ -135,17 +136,21 @@ def __init__(self, app: Sphinx, env: BuildEnvironment) -> None:
135136
self.parallel_ok = False
136137
self.finish_tasks: Any = None
137138

139+
@property
140+
def _translator(self) -> NullTranslations | None:
141+
return self.app.translator
142+
138143
def get_translator_class(self, *args: Any) -> type[nodes.NodeVisitor]:
139144
"""Return a class of translator."""
140-
return self.app.registry.get_translator_class(self)
145+
return self.env._registry.get_translator_class(self)
141146

142147
def create_translator(self, *args: Any) -> nodes.NodeVisitor:
143148
"""Return an instance of translator.
144149
145150
This method returns an instance of ``default_translator_class`` by default.
146151
Users can replace the translator class with ``app.set_translator()`` API.
147152
"""
148-
return self.app.registry.create_translator(self, *args)
153+
return self.env._registry.create_translator(self, *args)
149154

150155
# helper methods
151156
def init(self) -> None:
@@ -626,7 +631,7 @@ def read_doc(self, docname: str, *, _cache: bool = True) -> None:
626631

627632
filename = str(env.doc2path(docname))
628633
filetype = get_filetype(self.app.config.source_suffix, filename)
629-
publisher = self.app.registry.get_publisher(self.app, filetype)
634+
publisher = self.env._registry.get_publisher(self.app, filetype)
630635
self.env.current_document._parser = publisher.parser
631636
# record_dependencies is mutable even though it is in settings,
632637
# explicitly re-initialise for each document
@@ -661,7 +666,7 @@ def write_doctree(
661666
_cache: bool = True,
662667
) -> None:
663668
"""Write the doctree to a file, to be used as a cache by re-builds."""
664-
# make it picklable
669+
# make it pickleable
665670
doctree.reporter = None # type: ignore[assignment]
666671
doctree.transformer = None # type: ignore[assignment]
667672

0 commit comments

Comments
 (0)