The tests modify source files (e.g. index.rst) that are not restored
and thus another test could read an altered source file, it leading
to unexpected test results.
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
``searchfield.html`` is similar to the existing ``searchbox.html``, but does not
have the heading "Quick Search". Instead, it uses "Search" as a placeholder
text. This gives a cleaner and less cluttered appearance.
The searchfield component is added to the basic theme and thus can be used
in any derivative theme. It is not used by default for backward compatibility.
The searchfield compenent is made the default in the sphinx13 theme.
CSS changes ensure that the top of the search field is aligned with the
top of the main content.
* continuous integration: add comment explaining PYTHONWARNINGS env var to main unit test workflow
* continuous integration: unit test workflow: report-but-do-not-fail
when warnings about pkg_resources deprecation are encountered during
docutils dependency installation
* continuous integration: unit test workflow: instead of reducing the
severity of all DeprecationWarnings during docutils (non-dev)
installation, apply two message filters - one each for the warnings
encountered so far
* continuous integration: unit test workflow: add 'module' and 'line'
fields for warning filters
Ref:
https://docs.python.org/3/library/warnings.html#describing-warning-filters
---------
Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com>
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/
Update ``copy_image_files_pil`` so that the computation of ``nh`` is
always an integer, as otherwise some calls to ``PIL.Image.resize()``
fail as floats are not allowed
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
The current implementation of ``import_ivar_by_name`` filters
attributes if the name of the object that the attribute belongs to
does not match the object being documented. However, for inherited
attributes this is not the case. Filtering only on the attribute name
seems to resolve the issue. It is not clear to me if there are any
unwanted sideeffects of this and we should filter on the list of
qualnames for the object and all its super classes (if any).
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
With parallel run of tests, one gets "Address already in use" errors
as all tests attempt to bind to the same port. Fix it with a shared
file-system lock.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
When ``False``, the ``autosummary_ignore_module_all`` option adds
members to the module's members entry that will be used for autodoc,
but otherwise ignores it. As such, if a class is available in the
``__all__``, it won't be generated.
This commit aims to extend the ``__all__`` handling not only to
members, but also to corresponding attribute types (function,
classes, exceptions, modules)
The ``imported_members`` option is set to ``True`` if the object has
an ``__all__`` member and ``autosummary_ignore_module_all`` is ``False``
When using multiple processes, the content of
``self.env._write_doc_doctree_cache`` is not synchronised with the
main process, meaning we can only use it in serial mode.
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Currently, ``test_nosearch`` depends on ``html_search_language='de'``
from a previous test and thus fails if run individually.
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
The new ``python_display_short_literal_types`` configuration option
for the ``py`` domain controls display of PEP 586 ``Literal`` types.
The 'short' format is inspired by PEP 604, using the bitwise OR operator
to distinguish the possible legal values for the argument.