Commit Graph

19923 Commits

Author SHA1 Message Date
Adam Turner
44326fe247 Remove tests that rely on setuptools 2023-03-05 19:03:06 +00:00
Adam Turner
43e681e88f Remove `.egg support from pycode ModuleAnalyser`
Python eggs are a now-obsolete binary distribution format.
2023-03-05 19:03:06 +00:00
Adam Turner
f435fc05e6 Prefer `contextlib.chdir to sphinx.util.osutil.cd` 2023-03-05 18:49:17 +00:00
Hugo van Kemenade
219d71315c
Make `--jobs a synonym for -j` (#11210)
Make --jobs a synonym for -j
2023-03-05 14:37:35 +00:00
Adam Turner
c5641702b5 Update tests for Babel 2.12 (CLDR 42) 2023-03-05 13:32:37 +00:00
Adam Turner
18f8c0bfc8 Resolve lint errors from Ruff 0.0.254 2023-03-05 12:54:24 +00:00
Adam Turner
ba080286b0 Explicitly select all linter checks 2023-02-18 02:16:50 +00:00
Adam Turner
f363f1b058 Update Ruff configuration 2023-02-18 02:16:50 +00:00
Adam Turner
4804390604 Resolve `flake8-return` errors 2023-02-18 02:16:50 +00:00
Adam Turner
6c56988979 Unescape quotation marks where possible 2023-02-18 02:16:50 +00:00
Adam Turner
13442f6901 Fix pytest style issues 2023-02-18 02:16:50 +00:00
Adam Turner
dc1a519a1d Avoid `unittest.TestCase` methods 2023-02-18 02:05:14 +00:00
Adam Turner
f6435a9bc3 Prefer `@pytest.fixture()` 2023-02-18 01:58:05 +00:00
Adam Turner
c8f4a03dac Fix COM812 2023-02-18 01:58:05 +00:00
Jeremy Maitin-Shepard
8de6638697
Add `content_offset parameter to nested_parse_with_titles` (#11147)
Previously, ``nested_parse_with_titles`` always passed ``0`` as the input
offset when invoking ``nested_parse``.  When parsing the content of a
directive, as is a common use case for ``nested_parse_with_titles``,
this leads to incorrect source file/line number information, as it
does not take into account the directive's ``content_offset``, which is
always non-zero.

This issue affects *all* object descriptions due to GH-10887.  It also
affects the ``sphinx.ext.ifconfig`` extension.

The ``py:module`` and ``js:module`` directives employed a workaround for
this issue, by wrapping the calls to ``nested_parse_with_title`` with
``switch_source_input``.  That worked, but was more complicated (and
likely less efficient) than necessary.

This commit adds an optional ``content_offset`` parameter to
``nested_parse_with_titles``, and fixes callers to pass the appropriate
content offset when needed.

This commit eliminates the now-unnecessary calls to
``switch_source_input`` and instead specifies the correct ``content_offset``.
2023-02-15 05:45:28 +00:00
Jeremy Maitin-Shepard
44684e1654
Restore correct parallel search index building (#11192)
Revert b32841e153
to fix parallel search index building

The image-related changes were already reverted in
2a7c40d07f,
but the search index changes also need to be reverted.

It would be nice to support parallel search index building, but the
necessary support for merging the search indices produced by each
process needs to be added first.
2023-02-15 05:26:10 +00:00
Adam Turner
cfd43d4dbe Simplify coverage workflow reporting
``PYTHONDEVMODE`` and ``PYTHONWARNDEFAULTENCODING`` are used in the
main tests, remove from the coverage workflow.
2023-02-15 05:24:51 +00:00
Adam Turner
9b104523e9 Ignore `coverage.py` warnings 2023-02-15 05:14:44 +00:00
Karolina Surma
a7f5d91c29
Remove `smartypants` from LICENSE (#11152)
smartypants was removed from Sphinx in commit
ce31e1c0c7
2023-02-15 04:47:30 +00:00
Mike Taves
23bf041ce4
Remove unicode prefix (`u`) from strings (#11158) 2023-02-15 04:37:33 +00:00
Adam Turner
c17300aa7a Treat Python warnings as errors during testing 2023-02-15 04:34:10 +00:00
Adam Turner
a502e75233 Refactor `sphinx.util.images.guess_mimetype` 2023-02-15 04:10:18 +00:00
Adam Turner
607908924c Always cancel in-progress workflows on new commits
The current ``github.head_ref || github.run_id`` syntax only cancels
in-progress GitHub Actions runs triggered by pull requests, as
``head_ref`` is only defined for pull requests, and ``run_id`` is
always unique. This changes to using ``ref``, which is the name of
the branch or tag linked to the commit, meaning that in-progress jobs
will be cancelled on pushes to a branch.
2023-02-15 03:35:49 +00:00
Adam Turner
ff852bc7c3 Update GitHub Actions workflows 2023-02-15 03:10:50 +00:00
Adam Turner
bb9821b968 Resolve Ruff SIM114 violations 2023-02-15 02:09:47 +00:00
Jean-François B
6ffe7be080
LaTeX: workaround to help users of luatex-ja LaTeX classes (#11191)
Close #11179
2023-02-11 21:43:03 +01:00
Adam Turner
ffe4c079d3 Define `sphinx.builders.gettext.LocalTimeZone.tzname()` 2023-02-11 13:26:36 +00:00
Hugo van Kemenade
59cdb1ffe1
Ensure Ruff creates logs in colour for GitHub Actions (#11190) 2023-02-11 13:21:27 +00:00
Hugo van Kemenade
7f62f539be
Correct the Python Developer Guide markup style advice link (#11189) 2023-02-11 13:19:51 +00:00
Adam Turner
bd4684f483 Fix Ruff bidirectional text errors 2023-02-11 13:17:18 +00:00
Adam Turner
845ef67f6c Ignore some pylint checks in Ruff 2023-02-09 03:36:40 +00:00
Adam Turner
fd3c619dbf Collapse `.startswith and .endswith` tests 2023-02-09 03:36:17 +00:00
Jean Abou-Samra
ecfd08d325
Skip sphinx.locale.init_console when running tests (#11159)
Tests for Sphinx's CLIs, like test_apidoc, indirectly init_console to
initialize translations for Sphinx's console domain, the one with
Sphinx's log messages. This bleeds over subsequent tests by making
warnings translated. Fix this by skipping init_console when running
Sphinx's test suite.
2023-01-31 22:10:48 +00:00
Adam Turner
4c4745af9c Fix various Ruff errors 2023-01-31 18:30:43 +00:00
Adam Turner
7395b05b1c Ignore various lint checks in Ruff 2023-01-31 18:30:20 +00:00
Adam Turner
fedce24134 Ruff code TYP renamed to TCH 2023-01-31 18:13:53 +00:00
Jean-François B
b88713e68e Update LaTeX docs 2023-01-24 14:45:46 +01:00
Jean-François B
55170d01d7 LaTeX: `\emph replaced by \sphinxparam and \sphinxsamedocref` 2023-01-24 14:11:24 +01:00
Adam Turner
a7bf030944 Remove unneeded typing imports 2023-01-23 08:44:54 +00:00
Adam Turner
a6c21f92f8 Enable more Ruff checks 2023-01-23 08:32:25 +00:00
Adam Turner
b069d80924 Detect import sorting problems with Ruff 2023-01-23 08:10:22 +00:00
Adam Turner
999b20ff43 Sort imports with Ruff's convention 2023-01-23 08:10:03 +00:00
Adam Turner
3c8b76d1cc Ignore `S701` in Ruff 2023-01-23 08:07:31 +00:00
Adam Turner
bf88cd44d0 Ignore `SIM115` in Ruff 2023-01-23 08:07:31 +00:00
Adam Turner
a6b34dd13d Update `PL` code ignores in Ruff 2023-01-23 08:07:31 +00:00
Jean-François B
ddf4daf2c6
Doc of html_file_suffix (closes #11141) (#11144) 2023-01-22 19:32:12 +01:00
Jean-François B
6845c3fd96 Ignore UP031 check with Ruff 0.0.229 2023-01-22 18:54:22 +01:00
Jean-François B
3362021cfb
Merge pull request #11146 from jfbu/update_test_needs_sphinx
Update test_config.py::test_needs_sphinx for Alabaster 0.7.13 compat
2023-01-22 18:07:46 +01:00
Jean-François B
0fcd359663 Update test_config.py::test_needs_sphinx for Alabaster 0.7.13 compat
Relates #11145
2023-01-21 11:11:03 +01:00
Adam Turner
e17f39e7b5 Merge branch '6.1.x'
# Conflicts:
#	CHANGES
#	sphinx/__init__.py
2023-01-10 16:00:59 +00:00