Commit Graph

4911 Commits

Author SHA1 Message Date
Adam Turner
f3e0de1da0 Avoid using attributes of `app` 2025-02-16 04:25:08 +00:00
Adam Turner
f1fbbfcbb7 Add annotations to several single-argument ('app') test functions 2025-02-16 01:40:30 +00:00
Adam Turner
a980fbcafa Add return annotation to several zero-argument test functions 2025-02-15 23:23:56 +00:00
Bénédikt Tran
2364f169ad Fix parsing of PEP 695 functions (#13328) 2025-02-15 22:46:38 +00:00
Adam Turner
783884c0c8 Link to `docs.python.org instead of docs.python.jp` 2025-02-15 21:50:00 +00:00
Adam Turner
139d6b0936 Use full URLs for links to issues and pull requests 2025-02-15 21:47:31 +00:00
Adam Turner
2c46e547f8 Use the full URL for links to Breathe issues 2025-02-15 21:46:00 +00:00
Adam Dangoor
89797c728a Remove mypy overrides for `tests.test_builders.test_build_text` (#13341) 2025-02-15 20:16:34 +00:00
Adam Dangoor
3f2b211fb7 Remove mypy overrides for `tests.test_util.test_util_uri` (#13342) 2025-02-15 20:12:46 +00:00
Colin Marquardt
1431d44769 Fix typo 'unpickable' -> 'unpickleable' (#13344)
Normalize other occurrences of '~picklable' to '~pickleable'.

Note, there is no clear winner in the Python docs regarding usage of '~picklable' vs '~pickleable', so we pick the more greppable version.
2025-02-15 15:06:35 +01:00
Adam Turner
c49d925b4d Remove `productionlist` hard-coding in writers (#13326)
The ``productionlist`` directive operates in a line-based context, creating an ``addnodes.productionlist`` container
of ``addnodes.production`` nodes, with one per production in the directive. However, the full state of the abstract
document tree is not included in the produced nodes, with each builder/translator implementing a different way
of appending the fixed separator ``::=`` and justifying the displayed text.

This should not happen in the writer, and hard-coding such details hampers flexibility when documenting different
abstract grammars. We move the specific form of the ``.. productionlist::`` directive to the logic in the directive body
and have the writers apply minimal custom logic.

LaTeX changes written by Jean-François B.
2025-02-13 00:16:26 +00:00
Will Lachance
bb68e72333 Add ability to "skip" adding marked documentation to the search index (#11280)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-12 16:47:14 +00:00
Matthias Geier
94563a398b Un-deprecate `sphinx.util.import_object` (#13330)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-11 19:07:27 +00:00
Adam Turner
b678d17e00 Fix deprecation warning in `test_ModuleAnalyzer_get_module_source` 2025-02-11 03:13:46 +00:00
Adam Turner
47299b8229 Inline function in `get_verifier` 2025-02-11 01:53:26 +00:00
Adam Turner
b81a7d7477 Improve LaTeX skip decorators 2025-02-11 01:49:14 +00:00
Adam Turner
baddae6611 Move `test_log_no_ansi_colors` 2025-02-11 01:42:39 +00:00
Adam Turner
bb5716b54a Split out `test_build_all` 2025-02-11 01:34:12 +00:00
Adam Turner
c069960e8a Use blank testroot for `restructuredtext.parse()` 2025-02-11 01:11:19 +00:00
Adam Turner
ebec42c02b Move `make_app_with_empty_project() to conftest.py` 2025-02-11 00:53:44 +00:00
Adam Turner
4298c30886 Fix continuation line indentation in productionlists (#13319) 2025-02-10 02:00:52 +00:00
Adam Turner
790bee64ce intersphinx: Resolve implicit self-references (#13322)
When intersphinx_resolve_self was added, it only applied to the :external:<inv_name>:`blah` role.
This extends the functionality to implicit intersphinx references of the form :ref:`<inv_name>:blah`.
2025-02-09 22:29:04 +00:00
Adam Dangoor
03df8119b3 Remove mypy override for `tests.test_builders.test_build_html_copyright` (#13317) 2025-02-09 21:29:38 +00:00
Adam Turner
c4b3dcbaf9 Convert '0' and '1' to bool for config overrides (#13318) 2025-02-07 19:38:33 +00:00
Adam Dangoor
cef9d869dd Remove type check overrides for `tests/test_builders/test_build_gettext.py` (#13299)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-07 15:13:56 +00:00
Adam Dangoor
0782273dec Remove mypy overrides for two files in `tests/test_writers` (#13315) 2025-02-07 14:49:19 +00:00
Adam Dangoor
36e3f3250d Remove mypy overrides for `tests/test_extensions/test_ext_autodoc_autodata.py` (#13314) 2025-02-07 14:47:00 +00:00
Adam Dangoor
e33b6ff82d Remove mypy overrides for `tests/test_config` (#13313) 2025-02-07 14:45:25 +00:00
Adam Dangoor
d2627c44f3 Remove type check overrides for `tests/test_extensions/test_ext_githubpages.py` (#13306) 2025-02-07 14:43:27 +00:00
Adam Dangoor
6de28062fc Remove type check overrides for `tests/test__cli/test__cli_util_errors.py` (#13305) 2025-02-07 14:42:11 +00:00
Adam Dangoor
7799dd1b8b Remove type check overrides for `test_build_epub` (#13296) 2025-02-07 14:41:09 +00:00
Adam Turner
22e0f8944b Use pathlib in more places 2025-02-07 13:51:42 +00:00
pholica
766900e416 autodoc: Handle multiple inheritance correctly (#13136)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-03 01:46:35 +00:00
Bénédikt Tran
1b83e55809 autodoc: add support for `python_display_short_literal` (#12003)
Co-authored-by: James Addison <55152140+jayaddison@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-02 22:50:41 +00:00
Adam Turner
34519be296 Ignore test failures from broken Babel 2.17 on Windows (#13290) 2025-02-02 20:01:21 +00:00
Adam Turner
0d4425ce07 Use read-only test roots (#13285) 2025-01-31 18:04:36 +00:00
Adam Turner
17b8241585 Include test roots in `pytest_report_header()` 2025-01-31 17:22:51 +00:00
Tiger3018
af3bb3687c Use warning types and sub-types in more places (#11677)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-29 19:22:44 +00:00
Chris Sewell
134bd7f1fb Add `collapsible` option to admonition directives (#12507)
This PR adds the `collapsible` and option to the core admonition type directives, which are propagated to the nodes, e.g.

```restructuredtext
.. admonition:: title
   :collapsible:

   content

.. note:: content
   :collapsible: closed
```

For the HTML5 writer, this replaces the outer `div` with a `details` tag, and the title `p`  with a `summary` tag (with an `open` attribute if set), e.g.

```html
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>hallo</p>
</div>
```

changes to

```html
<details class="admonition note" open="open">
<summary class="admonition-title">Note</summary>
<p>hallo</p>
</details>
```

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-29 18:06:57 +01:00
Adam Turner
5667050dd2 Improve the displayed signature for abstract methods (#13271) 2025-01-29 02:34:46 +00:00
Adam Turner
82e9182d43 Initial implementation of an `_Inventory` type (#13275) 2025-01-29 00:46:08 +00:00
Tim Hoffmann
5871ce266a Add support for short signatures in autosummary (#13172)
This introduces a new ``:signatures:`` option to ``sphinx.ext.autosummary``.
Possible values are:

"long" (*default*):
  same as the current default

"short":
  format functions and classes as ``func()`` if they do not
  have arguments and ``func(…)`` if they do have arguments.

"none":
  replaces the pre-existing ``:nosignatures:`` (which becomes deprecated)

The new functionality here is the "short" option.
This allows to distinguish properties and attributes
from functions and classes without costing a lot of space
for a long signature.
2025-01-29 00:44:09 +00:00
Adam Turner
56e52fcdbe Fix type error in mocking `_fetch_inventory` (#13274) 2025-01-29 00:04:46 +00:00
Jonny Saunders
18bb8bcef5 Implement :no-index-entry: for autodoc (#12233)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-01-28 02:01:31 +00:00
Adam Turner
7801540c08 Support `:no-index-entry: in .. {js,py}:module::` (#13272) 2025-01-28 01:33:28 +00:00
Adam Turner
705c1beb16 Convert _INVALID_BUILTIN_CLASSES to use strings instead of runtime objects (#13270)
This is a more flexible approach that does not require importing several modules and types into ``sphinx.util.typing``.
2025-01-27 19:17:00 +00:00
Adam Turner
7406d4222f Move mypy test module exclusions to per-module ignores (#13265) 2025-01-26 19:41:15 +00:00
Adam Turner
42f300ee83 Rename the `:nowrap and :nosignatures:` directive options (#13264)
Rename the ``:nowrap`` and ``:nosignatures:`` directive options to
``:no-wrap`` and ``:no-signatures:``, for readability.
This mirrors changes already made to `:no-index`, `:no-index-entry`,
`:no-contents-entry`, and `:no-search` in Sphinx 7.2 and 7.3.
2025-01-23 04:30:46 +00:00
Adam Turner
ca2ab35d94 Add further types to `_INVALID_BUILTIN_CLASSES` (#13263) 2025-01-23 03:53:25 +00:00
Adam Turner
47bff3faea Add new `types types to _INVALID_BUILTIN_CLASSES` (#13262) 2025-01-23 03:35:53 +00:00