summaryrefslogtreecommitdiff
path: root/sphinx/domains/std.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated ``make_old_id`` functions (#11360)Adam Turner2023-04-271-37/+0
|
* Partially revert "Disable localisation when SOURCE_DATE_EPOCH is set ↵Adam Turner2023-04-211-2/+2
| | | | | (#10949)" (#11343) This keeps some of the added tests, and avoids a full revert of ``sphinx.locale``.
* Disable localisation when ``SOURCE_DATE_EPOCH`` is set (#10949)James Addison2023-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 typos found by codespellDimitri Papadopoulos2023-03-271-1/+1
|
* Resolve ``flake8-return`` errorsAdam Turner2023-02-181-2/+1
|
* Fix COM812Adam Turner2023-02-181-9/+9
|
* De-glob mypy whitelist for 'sphinx.domains.*' (#11064)danieleades2023-01-021-9/+15
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Run pyupgrade (#11070)Adam Turner2023-01-021-29/+29
|
* Use PEP 604 typesAdam Turner2023-01-011-17/+16
|
* Use PEP 595 typesAdam Turner2023-01-011-36/+36
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-011-0/+2
|
* remove blanket 'noqas'Daniel Eades2022-12-161-2/+4
|
* Merge branch '5.x'Adam Turner2022-10-161-4/+11
|\ | | | | | | | | | | | | | | # Conflicts: # .github/workflows/main.yml # CHANGES # sphinx/__init__.py # sphinx/domains/c.py
| * Extend cross referencing options with values (#10883)Martin Liška2022-10-021-4/+11
| | | | | | | | | | | | | | | | This change means that text following `=`, `[=`, or ` ` is ignored when searching for a corresponding option directive to an option cross reference role. These are commonly used options, for example `--profile=path`, `--profile[=path]` or `--profile path`. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* | Merge branch '5.x'Adam Turner2022-09-301-1/+7
|\ \ | |/ | | | | | | # Conflicts: # sphinx/locale/__init__.py
| * extend option directive syntaxMartin Liska2022-09-271-1/+7
| | | | | | | | One can cross-reference an option value: :option:`--module=foobar`.
* | Drop Python 3.7Adam Turner2022-09-271-9/+9
|/
* Fix mypy violations for v0.981 (#10875)Adam Turner2022-09-271-1/+1
|
* Docstring clarifications (#9877)Arthur Milchior2022-09-241-3/+3
| | | | | Co-authored-by: Jakob Lykke Andersen <jakobandersen@users.noreply.github.com> Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Fix mypy errorAdam Turner2022-09-121-1/+6
|
* Allow `:ref:` role to be used with definitions and fields (#10781)Jeremy Maitin-Shepard2022-09-061-5/+14
|
* Use the `flake8-comprehensions` lint plugin (#10601)danieleades2022-06-261-1/+1
|
* Fix parsing of options with enabled option_emphasise_placeholders (#10565)Martin Liška2022-06-191-17/+16
|
* Show the repr of the value in some warnings (#10439)Ezio Melotti2022-06-161-7/+7
| | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* Allow emphasising placeholders in `option` directives (#10366)Martin Liška2022-06-161-4/+32
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* `rawsource` is deprecated in `docutils.nodes.Text`Adam Turner2022-04-221-2/+2
|
* Remove deprecated code for Sphinx 5.0Adam Turner2022-04-171-22/+0
|
* Merge branch '4.x'Takeshi KOMIYA2022-03-281-5/+3
|\
| * Merge pull request #10178 from stephenfin/issue-10177Takeshi KOMIYA2022-03-271-5/+3
| |\ | | | | | | Revert "Close #9993: std domain: Allow to refer an inline target via ref role"
| | * Revert "Close #9993: std domain: Allow to refer an inline target via ref role"Stephen Finucane2022-02-081-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e3ee8b378a37958f48d97d74a5c264f1f02e153e. This is a breaking change that should not have been introduced in a minor release (or arguably at all, given the impact). Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #10177
* | | Merge branch '4.x'Takeshi KOMIYA2022-03-191-9/+1
|\ \ \ | |/ /
| * | Collapse single line docstringsAdam Turner2022-02-201-2/+1
| | |
| * | Remove copyright and licence fieldsAdam Turner2022-02-201-3/+0
| | |
| * | Fix module docstring indentationAdam Turner2022-02-201-2/+2
| | |
| * | Fix module docstring first lineAdam Turner2022-02-201-2/+1
| | |
| * | Remove module titles in docstringsAdam Turner2022-02-191-3/+0
| |/
* | Merge branch '4.x'Takeshi KOMIYA2022-01-171-1/+1
|\ \ | |/
| * Fix #9981: std domain: Strip value part of the option directive from genindexTakeshi KOMIYA2022-01-141-1/+1
| |
* | Merge branch '4.x'Takeshi KOMIYA2022-01-161-12/+4
|\ \ | |/
| * In translated docs, sort glossaries by translated termsJean Abou Samra2022-01-121-12/+4
| | | | | | | | | | | | | | This is done by moving the sorting from the glossary directive to a transform operating after the i18n transform. Closes #9827
* | Merge branch '4.x'Takeshi KOMIYA2022-01-031-1/+1
|\ \ | |/
| * Migrate to Node.findall() from Node.traverse()Takeshi KOMIYA2022-01-031-1/+1
| | | | | | | | | | | | | | | | 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.
* | Merge branch '4.x'Takeshi KOMIYA2022-01-011-1/+1
|\ \ | |/
| * A happy new year!Takeshi KOMIYA2022-01-011-1/+1
| |
* | Merge branch '4.x'Takeshi KOMIYA2021-12-241-3/+5
|\ \ | |/
| * Close #9993: std domain: Allow to refer an inline target via ref roleTakeshi KOMIYA2021-12-211-3/+5
| |
* | refactor: Remove RemovedInSphinx50Warning (partially)Takeshi KOMIYA2021-12-171-7/+0
|/
* refactor: Add Optional to type annotationsTakeshi KOMIYA2021-05-101-13/+15
|
* refactor: use raw Type for type annotationsTakeshi KOMIYA2021-04-041-1/+1
|
* refactor: Use PEP-526 based variable annotation (sphinx.domains)Takeshi KOMIYA2021-03-231-20/+21
|