Commit Graph

4831 Commits

Author SHA1 Message Date
Adam Turner
5ff3740063 Adapt tests for Pygments 2.19 2025-01-06 06:56:10 +00:00
Adam Turner
d59084a1fa Bump Ruff to 0.8.6 2025-01-06 06:05:55 +00:00
ProGamerGov
fec4d7c2f1 Viewcode: Fix issue with import paths that differ from the directory structure (#13195)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-05 10:43:57 +00:00
Adam Turner
83bf866059 Avoid attribute indirection with `env` (#13212) 2025-01-05 09:10:55 +00:00
Adam Turner
849d309db4 Napoleon: Use `:py:{...}` in type preprocessing 2025-01-05 02:13:15 +00:00
James Addison
872d270f10 linkcheck: support ignored-URIs for redirects (#13127)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-05 01:20:15 +00:00
Chris Barrick
8d75ae2d6b Napoleon: Unify the type preprocessing logic
Previously, there were two type preprocessing functions:
`_convert_type_spec` (used in Google-style docstrings) and
`_convert_numpy_type_spec` (used in Numpy-style docstrings).

The Google version simply applied type-alias translations or wrapped
the text in a `:py:class:` role.

The Numpy version does the same, plus adds special handling for keywords
`optional` and `default` and delimiter words `or`, `of`, and `and`. This
allows one to write in natural language, like `Array of int` instead of
`Array[int]` or `Widget, optional` instead of `Optional[Widget]` or
`Widget | None`. Numpy style is described in full at:
https://numpydoc.readthedocs.io/en/latest/format.html#parameters

This commit eliminates the distinction and allows Google-style
docstrings to use these preprocessing rules.
2025-01-05 01:18:29 +00:00
Adam Turner
02beccac0a intersphinx: Define a restricted subset of Config as `InvConfig` (#13210) 2025-01-05 01:06:51 +00:00
Adam Turner
619a10efa7 intersphinx: Simplify `_fetch_inventory()` (#13209)
The streams-based interfaces in intersphinx and ``sphinx.util.inventory``
are clever, but also complex and prevent using compression methods
that don't support incrememntal decoding. This change refactors
``_fetch_inventory()`` to read all inventory content from disk or an
HTTP request at once.
2025-01-05 00:34:49 +00:00
Adam Turner
e17ed74fe0 Remove unneeded content from within `with` statements 2025-01-04 09:11:33 +00:00
Maciej Olko
ad0c343d36 Trim leading whitespace before doctest flags (#13164) 2025-01-04 00:30:03 +00:00
Adam Turner
e65bbb96ae Create a new type for the current document's environment state (#13151) 2025-01-04 00:28:03 +00:00
Nicolas Peugnet
0fbf88a59f Allow extensions to define the keys returned by linkcode (#11824)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-03 21:28:34 +00:00
Adam Turner
3028e818c9 Remove test skips for Python 3.14 (#13041) 2025-01-03 07:31:40 +00:00
Adam Turner
00ad109a39 Run Ruff on `tests/roots/` 2025-01-03 01:33:14 +00:00
Adam Turner
b176c66f8c Enable the FURB113 lint in Ruff 2025-01-03 01:13:05 +00:00
Adam Turner
013dcdc3b8 Run Ruff on `tests/js/roots/` 2025-01-02 23:53:59 +00:00
Adam Turner
43bf986891 Enable the RET503 lint in Ruff 2025-01-02 23:49:44 +00:00
Adam Turner
2aad3a87f4 Enable the entire Q category in Ruff 2025-01-02 23:49:44 +00:00
Adam Turner
b5f9ac8afc Enable the RUF100 lint in Ruff 2025-01-02 23:49:43 +00:00
Adam Turner
5f6457911d Enable the RUF048 lint in Ruff 2025-01-02 23:49:43 +00:00
Adam Turner
05fc47f120 Enable the RUF043 lint in Ruff 2025-01-02 23:49:43 +00:00
James Addison
6678e35704 html search: add safety check before index property accesses (#13153) 2025-01-02 23:06:35 +00:00
Adam Turner
64937535dc Bump Ruff to 0.8.5 2025-01-02 21:11:36 +00:00
Adam Turner
ce070af2fa Avoid using camelCase names in domain tests 2024-12-09 15:10:18 +00:00
Adam Turner
51bbfe259e Avoid using camelCase names in napoleon tests 2024-12-09 14:59:36 +00:00
Adam Turner
34f5a8d503 Avoid using camelCase names in autodoc tests 2024-12-09 14:59:25 +00:00
Adam Turner
2d2b73c706 Avoid using camelCase names in autosummary tests 2024-12-09 14:57:08 +00:00
Adam Turner
19dfc3f5af Enable the RUF031 lint in Ruff 2024-11-30 19:22:30 +00:00
Adam Turner
d796a8ae21 Enable the RUF029 lint in Ruff 2024-11-30 19:21:35 +00:00
Adam Turner
2f1cd36798 Enable the RUF015 lint in Ruff 2024-11-30 19:19:34 +00:00
Adam Turner
3af48520d2 Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
Adam Turner
3cfccf3f1d Check exception message in test_env_relfn2path 2024-11-22 17:14:49 +00:00
Adam Turner
15b46dc81e Enable the entire PYI category in Ruff 2024-11-15 01:00:36 +00:00
Dimitri Papadopoulos Orfanos
f76ffdf02b Apply flake8-pyi rule PYI018 (#13116) 2024-11-15 00:36:01 +00:00
Adam Turner
efc36ac38f Bump Ruff to 0.7.3 2024-11-14 16:40:34 +00:00
Dmitry Shachnev
d6da26a7f5 Properly strip time zones which are west of UTC (#13128)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-11-13 21:53:01 +00:00
Dimitri Papadopoulos Orfanos
c427edb0bd Emend spelling errors (#13113)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-11-08 12:11:42 +00:00
Adam Turner
801c60a873 Consistently calculate the current file's directory 2024-11-03 17:28:02 +00:00
Adam Turner
1094556afb Bump Ruff to 0.7.2 2024-11-03 02:55:19 +00:00
Adam Turner
dedb21e638 Resolve _StrPath warnings in the tests 2024-11-02 21:39:18 +00:00
Adam Turner
116a430cac Accept PathLike in Sphinx.add_message_catalog() 2024-10-25 22:49:51 +01:00
Adam Turner
71c0fcfbc5 Use pathlib in the tests (#13051) 2024-10-25 22:41:08 +01:00
Adam Turner
8682f64b6f Use keyword-arguments with `IndexEntry` 2024-10-25 17:51:05 +01:00
James Addison
b75e695631 Write 'searchindex.js' using minimal JSON separators (#13062)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-24 17:54:41 +01:00
Adam Turner
bf77a4087a Use `_StrPath in sphinx.util.i18n` (#13050) 2024-10-20 22:03:24 +01:00
Adam Turner
cb5318bdc8 Use `_StrPath in sphinx.theming` (#13048) 2024-10-20 20:15:42 +01:00
Adam Turner
285908aa07 Use `_StrPath` in HTMLBuilder (#13045) 2024-10-20 01:46:52 +01:00
Adam Turner
dc852d66ea Fix pyright 2024-10-19 19:21:41 +01:00
Adam Turner
e58dd58f35 Enable the PLR6201 lint in Ruff 2024-10-19 19:05:43 +01:00