Commit Graph

20850 Commits

Author SHA1 Message Date
James Addison
9467bf7849
[typehints] tests: enable mypy for linkcheck builder tests. (#12160) 2024-05-15 04:13:57 +02:00
Rafael Fontenelle
c64002f1bd
DOCS: Add sphinx-build --jobs default value (#12368) 2024-05-15 03:40:33 +02:00
Michał Górny
ce86026f3b
DEPS: Lazy import defusedxml only when necessary (#12362)
The `defusedxml` dependency was added to `sphinx.testing` in sphinx 7.3,
but it is not part of the core sphinx dependencies, and not strictly necessary for the running of the pytest plugin.
This commit moves the import into the only function which uses it,
so that the pytest plugins can be used again without this dependency.
2024-05-11 18:31:02 +02:00
Ed Cormany
98f953e158
DOCS: improve :tocdepth: note (#12356) 2024-05-07 04:49:08 +02:00
Viktor Garske
88a54d8a13
Update EXAMPLES.rst: Linux kernel switched theme (#12348) 2024-05-05 19:07:32 +02:00
Matthias Geier
13b0fcc532
DOC: Add env_version to "todo" tutorial (#12349) 2024-05-05 19:04:10 +02:00
Matthias Geier
afcafe0409
DOC: add data_version to "recipe" tutorial (#12350) 2024-05-05 19:02:54 +02:00
Adam Turner
c41aab829d
Add `sphinx._cli` (#10877)
This is the first step towards a new ``sphinx`` command.
2024-04-29 03:03:15 +01:00
Adam Turner
0d74c85e8c
Extract inner check functions in `test_domain_cpp` (#12336) 2024-04-29 02:07:56 +01:00
Adam Turner
172a2aa88e
Minimise Ruff's `[format.exclude]` list (#12338) 2024-04-29 02:07:47 +01:00
Johannes Altmanninger
95a8553487
Do not emit manpage OSC 8 hyperlinks for anchor references (#12260)
A reference like ":ref:`Some other page <some-other-page>`" results
in a refuri "#some-other-page".  This does not seem useful to readers
of the man page. It is especially unhelpful when using a terminal
that implements a hint mode for selecting links -- the extra links
add noise, making it harder to select the interesting ones.
Don't emit OSC 8 for those.
2024-04-29 01:24:04 +01:00
Adam Turner
7c7f0d7f57 Add a CHANGES entry for #12314 2024-04-29 01:10:15 +01:00
Matthias Geier
76497988cb
Return `parallel_read_safe` in the autodoc_intenum tutorial (#12288)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-26 01:49:04 +01:00
Adam Turner
2dcc8f9fa9 Update pattern in `utils/bump_docker.py` 2024-04-25 21:13:33 +01:00
Adam Turner
938d3732f8
Collapse unions of `Literal types in stringify_annotation` (#12325) 2024-04-25 16:07:10 +01:00
Adam Turner
7953798074 Update to mypy 1.10 2024-04-25 16:04:06 +01:00
Adam Turner
3edf2a2c6b Style `sphinx.ext.intersphinx` 2024-04-25 15:45:28 +01:00
Adam Turner
14c1bc7fbe Rearrange `sphinx.ext.intersphinx._load` 2024-04-25 15:45:27 +01:00
Adam Turner
34393374a2 Rename `logger to LOGGER` 2024-04-25 15:30:55 +01:00
Chris Sewell
3dcd21af95 Split `sphinx.ext.intersphinx._resolve`
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 15:30:55 +01:00
Chris Sewell
49726c28f4 Split `sphinx.ext.intersphinx._load`
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 15:30:55 +01:00
Chris Sewell
b9a3f7e3df Split `sphinx.ext.intersphinx._cli`
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 15:30:55 +01:00
Chris Sewell
3a1f2f377c Split `sphinx.ext.intersphinx._shared`
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 15:30:55 +01:00
Chris Sewell
56b793d1c2 Define `__all__`
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 15:30:55 +01:00
Chris Sewell
3e8b8ab2d9 Move `sphinx.ext.intersphinx` into a package
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 15:30:55 +01:00
Adam Turner
3b907a1caa Import INVENTORY_FILENAME from canonical location 2024-04-25 13:35:06 +01:00
Benjamin Cabé
a66546895e
Properly support WebP in the image converter (#12224)
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-25 03:43:45 +01:00
Adam Turner
50895827ba Mark `test_restify_Annotated` as an expected failure 2024-04-25 03:07:48 +01:00
Adam Turner
6b70620993 Add a test for `restify(Annotated[...])` 2024-04-24 23:16:22 +01:00
Adam Turner
173b5912e5 linkcheck: Fix test to use dynamic port numbers 2024-04-24 19:36:36 +01:00
Matthias Geier
d7efb295f1
ext.duration: Fix `merge_domaindata()` (#12251)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-24 19:34:37 +01:00
James Knight
04b229fe4d
linkcheck: add `HyperlinkCollector.find_url()` (#12213)
Signed-off-by: James Knight <james.d.knight@live.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-24 19:19:44 +01:00
Will Lachance
208f4bcb66
HTML Search: Fix removal of unwanted anchor content from search results (#12321) 2024-04-24 19:09:14 +01:00
James Addison
2008aa8c78
linkcheck: Store the original (unquoted) anchor (#12206) 2024-04-24 18:07:31 +00:00
danieleades
6d6feb240f
Use Ruff's `extend-exclude` (#11901)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-04-24 19:00:00 +01:00
Françoise Conil
5fc2d515fd
Fix debug option in autosectionlabel documentation (#12324)
Co-authored-by: Françoise Conil <francoise.conil@insa-lyon.fr>
2024-04-24 18:59:30 +01:00
James Addison
9ebc46a74f
Remove test result sharing between 'test_html5_output' and 'test_html5_download' (#12119) 2024-04-24 07:45:36 +01:00
Bénédikt Tran
b5f3ef987a
Fix sphinx.util.inspect_evaluate_forwardref for Python 3.12.4 (#12317)
Python has recently [1] changed the signature of `_evaluate` for forward references
because of type parameters. The change affects 3.13, and was backported to 3.12.4.

[1]: https://github.com/python/cpython/pull/118104
2024-04-23 19:25:34 +01:00
Donald Hunter
85fd284476
C domain: fix performance regression since 3.0.0 (#12162)
Sphinx 3.0.0 onwards have a significant performance regression from
2.4.4 for the C domain. The cProfile output shows that this is due to
_find_named_symbols using a linear search.

Replace Symbol._children with dicts, one keyed by ident and one keyed by
docname. This lets us remove _find_named_symbols and replace these usage
patterns with fast child lookup. Also use the _anonChildren list to
speed up searching through anonymous children.

Note that dict is guaranteed to maintain insertion order since Python
3.7 so we retain iteration. Whenever iteration is required, we use
_childrenByName.values().

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Co-authored-by: Jakob Lykke Andersen <jakobandersen@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-04-23 19:10:55 +01:00
James Addison
0806a00f05
Support `.jinja` for theme static templates (#11916)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-04-23 10:40:24 +01:00
Adam Turner
5a55856dd1
Properly format `collections.abc.Callable` (#12314) 2024-04-23 08:01:09 +00:00
Bénédikt Tran
1ff9adfb62
Separate cases in `stringify and restify` with greater precision (#12284)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-23 08:37:04 +01:00
Bénédikt Tran
acc92ff615
Use `TypeGuard in sphinx.util.inspect` (#12283)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-23 05:55:24 +01:00
Bénédikt Tran
b6948b8d74
Style tweaks to `sphinx.util.typing` (#12282) 2024-04-23 05:36:04 +01:00
Nicolas Peugnet
55ca37f684
Add more internationalisation tests (#12277)
- Add test for basic literal block & literalinclude translation
- Add gettext builder test for litteral blocks additional targets
- Add i18n test for xref roles in titles
- Add i18n tests for strange markup
2024-04-23 05:22:43 +01:00
Adam Turner
2f2078fba3
Refactor C and C++ AST types (#12312)
- Define ``__eq__`` and ``__hash__`` methods for AST types
- Improve the base ``__eq__`` method
- Cache the value of ``is_anon()``
- Rename ``ASTIdentifier.identifier``
- Various other serialisation improvements
2024-04-23 03:56:32 +00:00
Adam Turner
67493fcbc7 Extract evaluation of non-type objects 2024-04-23 00:48:54 +01:00
Adam Turner
f4ff61a952 Validate modes in `sphinx.util.typing`
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-23 00:36:03 +01:00
Adam Turner
827e0209ca Combine determination of the module prefix 2024-04-23 00:36:03 +01:00
Adam Turner
0463ea86cc Extract functions to format `Literal` arguments
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-22 23:56:37 +01:00