Commit Graph

1181 Commits

Author SHA1 Message Date
Adam Turner
dec45eaf28 Bump Ruff to 0.9.0 2025-01-10 13:50:26 +00:00
Adam Turner
74ec220479 apidoc: Rename test roots 2025-01-07 11:06:29 +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
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
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
00ad109a39 Run Ruff on `tests/roots/` 2025-01-03 01:33:14 +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
801c60a873 Consistently calculate the current file's directory 2024-11-03 17:28:02 +00:00
Adam Turner
71c0fcfbc5 Use pathlib in the tests (#13051) 2024-10-25 22:41:08 +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
Adam Turner
3677dd1bca Shorten `copyright` in the ChangesBuilder tests 2024-10-04 12:33:03 +01:00
Adam Turner
5f3846f8c6 Improve testing for copyright year substitution (#12950) 2024-10-03 21:56:50 +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
Jean-François B.
1c131dfffe LaTeX: make contents, topic, and sidebar separately customizable (#12704)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-08-19 20:43:47 +02:00
Jean-François B.
4c7fe10a4b LaTeX: fix mark-up when \DUrole is used with multiple classes (#12745) 2024-08-17 20:33:15 +02:00
Adam Dangoor
ae8b37793d Improve typing for `mocksvgconverter.py` (#12788)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-16 22:35:32 +01:00
Jeremy Bowman
0cbdd98ffb Correctly support custom gettext output templates (#12645)
Co-authored-by: Jeremy Bowman <jmbowman@alum.mit.edu>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-08-11 20:34:04 +01:00
Adam Turner
d03156e078 Format `tests/` (#12760) 2024-08-11 14:58:56 +01:00
Adam Turner
a4102a7507 Specify encoding to avoid EncodingWarning 2024-07-29 18:21:01 +01:00
Adam Turner
7c4db269af Normalise `sys.path` manipulation in tests (#12665) 2024-07-23 16:55:21 +01:00
Adam Turner
217f267822 Do not overwrite user-supplied data by default when copying (#12647) 2024-07-22 16:00:16 +01:00
Bénédikt Tran
6c486a575c Fix detecting file changes for the overwritten file warning (#12627)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-20 14:31:53 +01:00
Adam Turner
2bd973e719 autodoc: Fix warnings with dataclasses in `Annotated` metadata (#12622) 2024-07-20 11:28:03 +01:00
Adam Turner
587da413ca Warn when files are overwritten in the build directory (#12612) 2024-07-19 08:20:48 +01:00
Adam Turner
e61f56950d Do not add the module prefix when generating autosummary documents (#12609) 2024-07-17 21:42:21 +01:00
Jean-François B.
152b78318d LaTeX: fix figures in seealso and seealso inside table cell (#12598)
This also fixes unreported issues unrelated to the 7.4.0 release:

- (now old style "lightbox") admonitions render badly in tabulary,
- "heavybox" admonitions (they are all now but warning et al. were already) cause PDF crash if in tabulary and rendered badly if in tabular or longtable.
- figure in a table cell is not properly separated from immediately preceding text.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-16 21:03:42 +01:00
Adam Turner
4bdef1b576 Remove old-styled `source_suffix` values in tests 2024-07-15 12:50:56 +01:00
Adam Turner
18ac58bd53 Fix possibly-invalid HTML when a rubric node is manually created 2024-07-15 10:04:48 +01:00
Bénédikt Tran
2a30bb661f Fix PEP 695 output for classes in the LaTeX builder (#12561) 2024-07-15 05:17:36 +01:00
Chris Sewell
41b363dbff [rst] Add level option to rubric directive (#12506)
This commit adds a `level` option to the `rubric` directive, which propagates a `level` attribute to the `rubric` node,
and allows renderers to select a specific heading level.

Logic for this attribute has been added to the HTML5 and LaTeX builder.
2024-07-14 05:52:58 +02:00
Jakob Lykke Andersen
e08f12f848 toctree: Use document nesting instead of domain nesting when adding domain objects (#12367)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-14 01:16:26 +01:00
Trevor Bekolay
2c0943784c Disallow module cycles in autosummary (#6792)
Consider the following piece of reST::

  .. automodule:: sphinx.ext.autosummary
     :members:

     .. autosummary::

        sphinx.ext.autosummary.Autosummary

This inserts an autosummary after the module docstring, but before
the members of the module. Without the change in this commit, this
would fail because `import_by_name` would attempt to import::

    sphinx.ext.autosummary.sphinx.ext.autosummary.Autosumary

because the prefix (from the parent) is `sphinx.ext.autosummary`,
and the name is `sphinx.ext.autosummary.Autosummary`, which is able
to be imported from `sphinx.ext.autosummary`, but is not the way
that anyone would want to refer to it.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-13 06:37:50 +01:00
James Addison
a6c2bdd371 Rename template files in Sphinx to use the `.jinja` extension (#12364) 2024-07-11 12:31:35 +01:00
Ashley Whetter
e38a60d3f2 Add `py:type` directive and role for documenting type aliases (#11989)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-11 12:15:54 +01:00
Stephen Finucane
6b37a6b2a2 Allow explicitly specifying modules in the coverage builder (#11592)
Currently there is no mechanism to identify totally undocumented modules
in the coverage builder, unlike with partially documented modules.
Resolve this by introducing a new ``coverage_modules`` config option.
This is a list of modules that should be documented somewhere
within the documentation tree. 
Any modules that are specified in the configuration value but 
are not documented anywhere will result in a warning. 
Likewise, any modules that are not in the config option but 
are documented somewhere will result in a warning.

Signed-off-by: Stephen Finucane <stephen@that.guru>
2024-07-11 07:36:36 +01:00
Adam Turner
82edc3d385 Rewrite `usage/configuration.rst` (#12537)
- Remove now-removed configuration values
- Use obvious 'unset' defaults for ``project`` and ``author``
- Prefer 'e.g.' to 'ex.'
- Allow non-list sequence types in various configuration values
- Add types and defaults to every confval directive
2024-07-10 21:43:14 +01:00
tuncbkose
bdd9140842 Remove custom SVG processing in the HTML builder (#12425)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-10 18:31:01 +00:00
James Addison
778013f91a Regression: restore extraction of data-URI images from source for builders whose output formats do not support them natively (#12344) 2024-07-03 02:16:43 +01:00
Nicolas Peugnet
ac3f74a3e0 [tests] Add intl regression test for term not found warning (#12388)
Add test for term not found warning in test_intl to prevent future regressions
2024-05-19 12:14:13 +02:00
James Addison
2008aa8c78 linkcheck: Store the original (unquoted) anchor (#12206) 2024-04-24 18:07:31 +00:00
James Addison
0806a00f05 Support `.jinja` for theme static templates (#11916)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-04-23 10:40:24 +01:00
Nicolas Peugnet
55ca37f684 Add more internationalisation tests (#12277)
- Add test for basic literal block & literalinclude translation
- Add gettext builder test for litteral blocks additional targets
- Add i18n test for xref roles in titles
- Add i18n tests for strange markup
2024-04-23 05:22:43 +01:00
James Addison
67303920fe Make the test suite connectivity-agnostic (#12095)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-04-12 23:32:12 +01:00
James Addison
df3cde65fa [tests] linkcheck: bind each test HTTP server to a unique port per-testcase (#12126)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-04-04 11:25:53 +02:00
Chris Sewell
04bd0df100 👌 Improve external role warnings (and revert object fallback) (#12193)
The key issue this commit seeks to address, is that existing tools / documentation often lead users to mistakenly use object types and not role names, a classic example being `function` not `func`

Previously, the warning message for using e.g. `` external:function`target` `` (with `py` as the default domain), would be:

```
WARNING: role for external cross-reference not found: function
```

This gives no information to the user on how to fix the issue, even though there is actually quite an easy fix

This commit adds logic to create more specific / helpful warning messages, e.g.

```
WARNING: role for external cross-reference not found in domains 'py', 'std': 'function' (perhaps you meant one of: 'py:func', 'py:obj')
```

This goes through the same original logic but, if the role is not found, it will look if the role name is actually an available object type on the domain(s), and then suggest its related roles.

This commit also reverts #12133, which provided a (silent) fallback to auto convert an object type to a role name.
2024-03-25 14:39:51 +01:00
James Addison
4eede5c534 [tests] Increase timeouts for linkcheck build tests. (#12166)
This is an attempt to resolve intermittent failures of the linkcheck tests currently occuring on the GitHub CI
2024-03-21 21:46:27 +01:00