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
74ec220479
apidoc: Rename test roots
2025-01-07 11:06:29 +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
47599df1bc
apidoc: Add `--automodule-options
`
2025-01-07 08:05:20 +00:00
Adam Turner
df06e6d628
Add `InventoryFile.loads()
` ( #13215 )
2025-01-07 00:40:57 +00:00
Adam Turner
b852618c1b
Avoid using camelCase names
2025-01-07 00:17:00 +00:00
Adam Turner
91bae649c1
Remove shebang from test-apidoc-toc test root
2025-01-06 21:55:29 +00:00
Adam Turner
a69d79bf67
Add .gitattributes
2025-01-06 21:55:29 +00:00
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
Adam Turner
903da2046e
Enable the PLR1714 lint in Ruff
2024-10-19 19:05:43 +01:00
Adam Turner
b64e03a5fb
Enable the S701 lint in Ruff
2024-10-19 19:05:42 +01:00
Adam Turner
f2d3a62865
Enable the S607 lint in Ruff
2024-10-19 19:05:42 +01:00
Adam Turner
c5dce468bc
Enable the PLW3201 lint in Ruff
2024-10-19 19:05:42 +01:00
Adam Turner
3920af4700
Enable the PLW0603 lint in Ruff
2024-10-19 19:05:42 +01:00
Adam Turner
9e1c27aca0
Enable the PLC0206 lint in Ruff
2024-10-19 01:16:07 +01:00
Adam Turner
c78b4c5404
Enable the PLE0704 lint in Ruff
2024-10-19 01:15:09 +01:00
Adam Turner
dc29ad1fde
Format test_sphinx_admonitions()
2024-10-18 20:48:41 +01:00
Adam Turner
ed8045ceea
Test on Python 3.14 ( #12978 )
2024-10-18 01:22:37 +01:00
Adam Turner
6c52c922e5
Support Enum signatures in Python 3.12 and 3.13
2024-10-18 00:42:21 +01:00
Adam Turner
cef2bcec36
Refactor `_EnumFormatter
`
2024-10-18 00:29:03 +01:00
Adam Turner
d3956894d7
Use the non-deprecated name for EnumType
2024-10-17 23:42:21 +01:00
Adam Turner
423452cdc2
Improve repr for TypeAliasForwardRef
2024-10-17 23:22:24 +01:00
Adam Turner
541bf7bc67
Drop support for Python 3.10 ( #13000 )
2024-10-17 20:59:41 +01:00
Adam Turner
62e9606d63
Restore support for `cut_lines()
` with no object type ( #13015 )
2024-10-12 23:14:24 +01:00
Hugo van Kemenade
58263e2cb0
Update CVE URL ( #13006 )
2024-10-11 22:28:10 +01:00
Adam Turner
c87b758de8
Fix tests for Python 3.12.7 ( #12993 )
2024-10-10 12:19:57 +01:00
khanxmetu
8351936994
Ensure deterministic resolution of toctree ( #12888 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-09 21:20:25 +01:00
Adam Turner
886bb945af
Log differences in configuration from the pickled environment ( #12949 )
2024-10-08 06:25:49 +01:00
Übertreiber
cc1b13ccbf
intersphinx: fix flipped use of intersphinx_cache_limit
. ( #12905 )
...
Co-authored-by: Nico Madysa <nico.madysa@cern.ch>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-07 21:19:20 +01:00
Jakub Stasiak
e04d042f8f
Improve the formatting for RFC section anchors ( #11809 )
...
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-06 04:29:11 +01:00
Hugo van Kemenade
09ab6edde5
Add CVE and CWE roles ( #11781 )
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-05 18:44:14 +01:00
Adam Turner
f7fa020cc2
Bump types-docutils to 0.21.0.20241005 ( #12976 )
2024-10-05 18:11:47 +01:00
Adam Turner
71598455a2
Add `sphinx.util._lines
`
2024-10-05 16:54:31 +01:00
Adam Turner
40f8693661
Add `sphinx.util._uri
`
2024-10-05 16:47:26 +01:00
Adam Turner
a0fe15c00d
Report GIL status in pytest
2024-10-04 16:55:39 +01:00
Adam Turner
dd17d4faa5
Bump types-docutils to 0.21.0.20241004 ( #12960 )
2024-10-04 15:41:25 +01:00
Adam Turner
be52db2bb3
Support placeholders for years in copyright ( #12910 )
2024-10-04 13:52:29 +01:00
Adam Turner
3677dd1bca
Shorten `copyright
` in the ChangesBuilder tests
2024-10-04 12:33:03 +01:00
Adam Turner
7195d9a662
Remove copyright and licence comments from theme asset files
2024-10-04 12:31:45 +01:00
Adam Turner
45273f292e
Remove titles from theme assets
2024-10-04 12:27:26 +01:00
James Addison
a84f7009ac
Restrict substitution of `copyright
` years ( #12516 )
...
Only substitute copyright notice years with values from
``SOURCE_DATE_EPOCH`` for entries that match the current
system clock year, and disallow substitution of future years.
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-04 10:48:47 +01:00
Adam Turner
5f3846f8c6
Improve testing for copyright year substitution ( #12950 )
2024-10-03 21:56:50 +01:00
danieleades
7546545876
Further improve typing in tests/
( #12816 )
...
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-03 20:17:40 +01:00
James Addison
80c4b65a2a
apidoc: Restore support for legacy '_t'-suffix template files ( #12929 )
...
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-03 00:21:03 +01:00
James Addison
abb3ead01a
tests: text builder: resolve an ordering conflict between two section-number-related tests ( #12868 )
2024-09-28 19:23:25 +02:00
khanxmetu
0a162fa8da
i18n: disable default smartquotes for zh_CN
and zh_TW
( #12875 )
2024-09-28 00:18:54 +02:00
Adam Dangoor
7487e764cb
Resolve a few mypy issues in tests ( #12912 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-09-25 08:57:11 +01:00
Adam Turner
45b7ebdc17
Allow using GMT in the HTML last updated format ( #12907 )
2024-09-22 07:55:09 +01:00
Adam Turner
76110c3ea0
Add `_DomainsContainer
` for better static typing ( #12783 )
...
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
2024-09-18 03:50:27 +01:00
Adam Turner
71b1a06024
Fix tests for Docutils revision 9928 ( #12897 )
2024-09-18 02:10:10 +01:00