Commit Graph

21748 Commits

Author SHA1 Message Date
Adam Turner
31de02cc52
Bump Ruff to 0.9.2 (#13250) 2025-01-18 00:35:09 +00:00
Adam Turner
e5131ba1bd
intersphinx: Create an `_InventoryItem` type (#13248) 2025-01-17 00:41:11 +00:00
Valentin Pratz
cfb47865d6
autosummary: Respect empty module `__all__` (#13187)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-01-16 23:36:31 +00:00
Adam Turner
a0cd666906 intersphinx: Simplify domain detection in `IntersphinxRole.run()` 2025-01-16 21:49:35 +00:00
Adam Turner
f1ffe22fc9 intersphinx: Simplify `IntersphinxRole.is_existent_role()` 2025-01-16 21:49:34 +00:00
Adam Turner
4a1efef211 intersphinx: Avoid passing the full `BuildEnvironment` object 2025-01-16 21:43:47 +00:00
Adam Turner
d19eedf51d intersphinx: Simplify to `domain_name` where possible 2025-01-16 21:40:20 +00:00
Adam Turner
1a6672cb78 intersphinx: Use non-streaming `requests.get()` 2025-01-16 21:38:45 +00:00
Adam Turner
121181ae88 intersphinx: Specify types for config values 2025-01-16 21:38:00 +00:00
Adam Turner
ac5f51d570 intersphinx: Sort `__all__` 2025-01-16 21:37:47 +00:00
Slawomir Figiel
67f6154be3
Allow suppressing warnings for non-matching `toctree` glob patterns (#13230)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-16 18:17:21 +00:00
Takayuki SHIMIZUKAWA
099b91a9d9
Bump `ENV_VERSION for _CurrentDocument` (#13246)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-16 17:53:40 +00:00
Adam Turner
a56fdad70b
Use `sphinx._cli.util.colour in sphinx.util.console` (#13241) 2025-01-16 16:57:28 +00:00
dependabot[bot]
dd7a00dfb5
Bump pyright to 1.1.392.post0 (#13245) 2025-01-16 12:37:24 +00:00
Adam Turner
4fbcc2098e
intersphinx: Import names from proper places (#13244) 2025-01-15 21:41:34 +00:00
Adam Turner
182c831c7d
Disambiguate `:type:` as a directive option or info-field-list item (#13242) 2025-01-15 00:20:42 +00:00
Adam Turner
2431c665d6
Enable colour by default in when running on CI (#13240) 2025-01-14 19:57:07 +00:00
Adam Turner
501b8258fc
Unconditionally copy static assets in `Builder` (#13236)
Remove an early exit check for when ``docnames`` is empty.
Previously,  when building in incremental mode, static assets
(for example from HTML themes) would only be copied
when at least one document had been modified.
2025-01-14 17:39:10 +00:00
Adam Turner
b064ef3879 Enable the entire DOC category in Ruff 2025-01-14 16:04:18 +00:00
Adam Turner
c4daa95c09 Enable the entire D category in Ruff 2025-01-14 15:55:02 +00:00
Adam Turner
dbf62cd503 Enable the entire RET category in Ruff 2025-01-14 14:56:30 +00:00
Adam Turner
c66d3e85d1 Enable 11 more categories in Ruff
* flake8-builtins ('A')
* flake8-blind-except ('BLE')
* flake8-copyright ('CPY')
* eradicate ('ERA')
* flake8-boolean-trap ('FBT')
* flake8-fixme ('FIX')
* flake8-implicit-str-concat ('ISC')
* pep8-naming ('N')
* flake8-use-pathlib ('PTH')
* flake8-self ('SLF')
* tryceratops ('TRY')
2025-01-14 14:43:02 +00:00
Adam Turner
3521cb60cf Enable the entire TD category in Ruff 2025-01-14 12:52:43 +00:00
Adam Turner
d102e62bc7 Format code blocks in docstrings 2025-01-14 12:17:46 +00:00
Adam Turner
cc8161a066 Move `sphinx.util re-exports to module __getattr__` 2025-01-14 01:01:52 +00:00
Adam Turner
b52ac5c71b Review, reduce, and sort per-file ignores in Ruff 2025-01-13 23:59:11 +00:00
Adam Turner
fd8ce84582 Enable the RUF001 lint in Ruff 2025-01-13 23:40:26 +00:00
Adam Turner
477401c4e4 Enable the G003 lint in Ruff 2025-01-13 23:21:30 +00:00
Adam Turner
66905d24e1 Use strict flake8-type-checking settings in Ruff 2025-01-13 21:56:36 +00:00
Adam Turner
f6d1665f84 Use frozensets for permitted types in `app.add_config_value()` 2025-01-13 21:18:17 +00:00
dependabot[bot]
e7dd42ea91
Bump Ruff to 0.9.1 (#13235) 2025-01-13 07:09:06 +00:00
Bénédikt Tran
2a19d293b6
autodoc: fix detection of class methods implemented by extension modules (#13200)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-12 11:07:30 +00:00
Adam Turner
72ce43619c
Remove unneeded runtime typing imports (#13233) 2025-01-12 01:04:14 +00:00
Adam Turner
d29c2c1ff3
Implement key splitting in the `:kbd: role and remove KeyboardTransform` (#13227)
``KeyboardTransform.run`` takes 1.2% of the runtime of a build, but
is not be needed if ``:kbd:`` is converted to a proper role.

We implement key splitting in the ``:kbd:`` role, and return a sequence
of parsed nodes rather than a nested collection of roles with ``class="kbd compound"``.
2025-01-10 19:51:17 +00:00
Adam Turner
fdb1b0cdad Update documentation for the `:no-search:` file-wide metadata option 2025-01-10 16:56:21 +00:00
Adam Turner
404e4ffbed Consolidate both `handle_exception()` implementations 2025-01-10 15:52:39 +00:00
Adam Turner
dec45eaf28 Bump Ruff to 0.9.0 2025-01-10 13:50:26 +00:00
Adam Turner
bd864d6858 Define `__slots__ in sphinx.builders.gettext` classes 2025-01-10 12:11:29 +00:00
James Addison
267fe9afa8
Tests: explicitly unset SOURCE_DATE_EPOCH during 'test_html_multi_line_copyright' (#13224)
Sphinx's copyright substitution currently allows years identified as
the current year to be downgraded to previous years when
``SOURCE_DATE_EPOCH`` is configured, to assist reproducibility [1] of
documentation builds.

However, we have a test case ``test_html_multi_line_copyright``,
written in 2024, that mentioned a future year (2025).

Now that we have reached 2025, it is eligible for substitution when
``SOURCE_DATE_EPOCH`` is configured.  Many buildsystems, such as those
used by Debian and Fedora, choose the most-recent packaging/commit
timestamp to use as `SOURCE_DATE_EPOCH`'s timestamp, since those
correspond sensibly to a time-of-build.

However, for the Sphinx 8.1.3 release including the updated
substitution logic, the year-of-release/commit was 2024. Thus, if a
commit/packaging date from that year is chosen, and
``SOURCE_DATE_EPOCH`` is configured when the unit tests run, the
``test_html_multi_line_copyright`` test will fail.

The fix suggested here is to explicitly unset ``SOURCE_DATE_EPOCH``
within ``test_html_multi_line_copyright``.

[1]: https://www.reproducible-builds.org/

Authored-by: Colin Watson <cjwatson@debian.org>
Co-authored-by: Colin Watson <cjwatson@debian.org>
Authored-by: James Addison <55152140+jayaddison@users.noreply.github.com>
Co-authored-by: James Addison <55152140+jayaddison@users.noreply.github.com>
2025-01-10 11:21:11 +00:00
Adam Turner
95df419f49 apidoc: Move ApidocOptions to `sphinx.ext.apidoc._shared` 2025-01-10 02:12:20 +00:00
Adam Turner
d42cfa702f Further minor copyediting of the 'extension metadata' section 2025-01-10 01:26:17 +00:00
Adam Turner
daade2715a Rewrite the 'extension metadata' section 2025-01-10 01:09:49 +00:00
Adam Turner
74ec220479 apidoc: Rename test roots 2025-01-07 11:06:29 +00:00
Adam Turner
8e6883f8a0 apidoc: Rename `CliOptions to ApidocOptions` 2025-01-07 10:49:40 +00:00
Adam Turner
2c117bbbf0 Split out `sphinx.ext.apidoc._shared` 2025-01-07 10:41:40 +00:00
Adam Turner
5176a8f33a apidoc: Split `main()` into funtions 2025-01-07 09:35:23 +00:00
Adam Turner
fd3e7d3902 Convert CliOptions to a dataclass 2025-01-07 09:15:52 +00:00
Adam Turner
8732b2324a Split out `sphinx.ext.apidoc._generate` 2025-01-07 08:33:20 +00:00
Adam Turner
2bd70193b7 Split out `sphinx.ext.apidoc._cli` 2025-01-07 08:32:11 +00:00
Adam Turner
3a6111f141 Move `sphinx.ext.apidoc` into a package 2025-01-07 08:05:27 +00:00