Commit Graph

17 Commits

Author SHA1 Message Date
Adam Turner
849d309db4 Napoleon: Use `:py:{...}` in type preprocessing 2025-01-05 02:13: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
b5f9ac8afc Enable the RUF100 lint in Ruff 2025-01-02 23:49:43 +00:00
Adam Turner
51bbfe259e Avoid using camelCase names in napoleon tests 2024-12-09 14:59:36 +00:00
Adam Turner
3af48520d2 Require the PEP 563 'annotations' future import 2024-11-22 21:54:26 +00:00
Adam Turner
15b46dc81e Enable the entire PYI category in Ruff 2024-11-15 01:00:36 +00:00
Adam Turner
1094556afb Bump Ruff to 0.7.2 2024-11-03 02:55:19 +00:00
Adam Turner
dc29ad1fde Format test_sphinx_admonitions() 2024-10-18 20:48:41 +01:00
Adam Turner
0b17bb1029
Always define the builder and `testroot when using the app` fixtureture (#12775) 2024-08-12 22:34:03 +01:00
Adam Turner
d03156e078
Format `tests/` (#12760) 2024-08-11 14:58:56 +01:00
Adam Turner
1f2891530d
Use `app.status and app.warning` in tests (#12663) 2024-07-23 15:35:55 +01:00
Adam Turner
9e3f4521db
Drop support for Python 3.9 (#12633) 2024-07-22 15:05:15 +01:00
Adam Turner
e174df2762
Rename `normalize_intersphinx_mapping to validate_intersphinx_mapping` (#12643) 2024-07-22 13:32:44 +01:00
Bénédikt Tran
885818bb7f
[tests] move utilities and static data into dedicated modules and remove `html5lib` (#12173)
Since #12168, HTML files are now XML compliant, hence ``html5lib`` is no more needed as a testing dependencies.
2024-03-25 11:03:44 +01:00
Bénédikt Tran
b587eb243a
Fix `:paramtype:` reference targets (#11964) 2024-02-14 00:04:49 +01:00
danieleades
f9c8943889
Use `# NoQA` consistently (#11903)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-01-21 20:20:58 +00:00
Adam Turner
462404cb25 Organise tests into directories 2024-01-17 03:56:35 +00:00