| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(#10949)" (#11343)
This keeps some of the added tests, and avoids a full revert of ``sphinx.locale``.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit disables Sphinx's localisation features when reproducible
builds are requested, as determined by a non-empty SOURCE_DATE_EPOCH_
environment variable.
The `Reproducible Builds`_ project aims to provide confidence to
consumers of packaged software that the artefacts they're downloading
and installing have not been altered by the environment they were
built in, and can be replicated at a later date if required.
Builds of localised documentation using Sphinx currently account for
a large category of reproducible build testing failures, because the
builders intentionally use varying environment locales at build-time.
This can affect the contents of the ``objects.inv`` file.
During investigation, it turned out that many ``gettext``-localised
values (particularly in Python modules under ``sphinx.domains``) were
being translated at module-load-time and would not subsequently be
re-localised.
This creates two unusual effects:
1. Attempting to write a test case to build the same application in
two different languages was not initially possible, as the
first-loaded translation catalogue (as found in the
``sphinx.locale.translators`` global variable) would remain in-use
for subsequent application builds under different locales.
2. Localisation of strings could vary depending on whether the
relevant modules were loaded before or after the resource
catalogues were populated.
We fix this by performing all translations lazily so that module
imports can occur in any order and localisation of inventory entries
should occur only when translations of those items are requested.
Localisation can then be disabled by configuring the ``gettext``
language to the ISO-639-3 'undetermined' code (``'und'``), as this
should not have an associated translation catalogue. We also want to
prevent ``gettext`` from attempting to determine the host's locale
from environment variables (including ``LANGUAGE``).
.. _SOURCE_DATE_EPOCH: https://reproducible-builds.org/docs/source-date-epoch/
.. _Reproducible Builds: https://www.reproducible-builds.org/
|
| |
|
|
|
|
|
| |
Fix several reference errors throughout the documentation and set
``nitpick_ignore`` in ``doc/conf.py``.
|
|
|
| |
Closes: #11110
|
|
|
|
|
|
|
| |
Before, the apply method was one big 400-line chunk. This just splits it
up into more manageable chunks by introducing a ``_NodeUpdater`` auxiliary
class holding logic for updating various types of references.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This allows using Ruff's import sorting fixers
|
| |
|
|
|
| |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Also fix two PLW0602 warnings (``global`` without assignment) and
five PLW0120 warnings (else clause on loop without break).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix flake8 warnings
* Deactivate (provisorily) testing with 3.12-dev
(refs:
https://github.com/sphinx-doc/sphinx/pull/10995#issuecomment-1330310586
)
* Escape # in tox.ini for tox 4 compatibility ('du-latest' tests)
Co-authored-by: Daniel Eades <danieleades@hotmail.com>
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
# Conflicts:
# CHANGES
# doc/conf.py
# sphinx/__init__.py
# sphinx/builders/html/__init__.py
# sphinx/domains/python.py
# tests/test_build_html.py
|
| |
| |
| |
| | |
- Ensure `pycon3` is always normalised to `pycon`
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| | |
# Conflicts:
# setup.py
# sphinx/application.py
# sphinx/environment/__init__.py
# sphinx/ext/autodoc/directive.py
# tests/test_build_html.py
|
| | |
|
| |
| |
| | |
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
|
|\ \
| |/
| |
| |
| |
| |
| |
| | |
Resolved merge conflicts:
sphinx/ext/extlinks.py
sphinx/ext/napoleon/docstring.py
(and removed from the latter a now unused import for flake8 F401
compliance)
|
| | |
|
|/ |
|
| |
|
| |
|
|\
| |
| | |
Implement #noqa for i18n
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When cross-references in the original paragraph and the translated
paragraph do not match, a warning is emitted. It is useful, because
it allows to catch mistakes, but it can also be an annoyance since
sometimes it is expected that the cross-references will not match.
For example, a reference that is repeated in the original text may
need to be factored out for good style in the target language.
Another example: if the translator needs to translate a universally
understood term in the source language into a term that not everyone
knows is the translation of this original term, adding a reference to
the glossary can be warranted. This allows the translated message to
start with '#noqa' in order to disable the warning.
|
| |
| |
| |
| |
| | |
This allows suppressing them using the suppress_warnings configuration
variable.
|
|\ \
| | |
| | | |
ImageConverter: ignore '?' image URIs
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
danieleades/refactor/unused-loop-control-variables
address some unused loop control variables
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
This is done by moving the sorting from the glossary directive to a
transform operating after the i18n transform.
Closes #9827
|
|
|
|
|
|
|
|
| |
Node.traverse() was marked as deprecated since docutils-0.18. Instead
of it, Node.findall() has been added as successor of traverse().
This applies a patch to docutils-0.17 or older to be available
Node.findall() and use it.
|