Commit Graph

20166 Commits

Author SHA1 Message Date
Adam Turner
6079f28faa Install twine in PyPI publish workflow 2023-07-24 15:26:17 +01:00
Adam Turner
3d43b9efdb Fix github-script syntax in create-release.yml 2023-07-24 15:20:28 +01:00
Adam Turner
a539ce78f5 Add GitHub Actions environment; fix variable names 2023-07-24 15:12:46 +01:00
Adam Turner
c161e9c286 Publish releases to PyPI
Implement the PyPI trusted publisher OIDC flow within GitHub Actions.
2023-07-24 14:58:06 +01:00
github-actions[bot]
05c3ad0327
[bot]: Update message catalogues (#11255)
Co-authored-by: AA-Turner <AA-Turner@users.noreply.github.com>
2023-07-24 13:45:52 +01:00
Adam Turner
5c31195e91 Include the translated string in babel error messages 2023-07-24 13:33:12 +01:00
Adam Turner
1437d2a746 Reduce heading underline length for "Testing" 2023-07-24 13:00:29 +01:00
Adam Turner
dc14b4288e Update CHANGES for Sphinx 7.1.0 2023-07-24 12:51:58 +01:00
Adam Turner
914c317a1e Provide timezone information in `datetime.fromtimestamp`
Python 3.12 has deprecated ``datetime.utcfromtimestamp``,
use timezone-aware datetime objects instead.
2023-07-24 12:40:28 +01:00
picnixz
82bc15aec3
Enable skipping anchor verification on a per-URL basis (#11489)
Add a new ``linkcheck_anchors_ignore_for_url`` configuration variable.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-24 12:15:42 +01:00
James Addison
d15a837c61
Emend hyperlinks within the CHANGES and EXAMPLES (#11506)
* Remove "dead" links
* Update project links to the correct hostnames
2023-07-24 11:49:44 +01:00
Adam Turner
e4d1477c05
Test with Python 3.13 alpha releases (#11507) 2023-07-24 11:46:14 +01:00
picnixz
e11bf76919
Fix `MemoryError in sphinx.ext.intersphinx when using None or typing.*` as inline type references (#11338)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-24 11:35:12 +01:00
Adam Turner
24b4d65a02
Re-structure index entry processing (#11505) 2023-07-24 03:17:29 +01:00
picnixz
480630c649
Support PEP 695 and PEP 696 syntax in the Python domain (#11444)
* Generic classes can be documented with ``.. py:class::`` using PEP 695 syntax:

  .. code:: rst

     .. py:class:: Sequence[T]

* Generic functions can be documented with ``.. py:function::`` using PEP 695 syntax:

  .. code:: rst

     .. py:function:: foo[T](x: T)

* Default values for type bounds are supported.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 23:22:40 +01:00
Adam Turner
f5aadc1c3f Remove "Release signatures" section of the README
PyPI has stopped supporting signed releases.

https://blog.pypi.org/posts/2023-05-23-removing-pgp/
2023-07-23 23:17:46 +01:00
James Addison
450ad637ac
Begin using session-based HTTP requests in the linkcheck builder (#11503)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 22:23:08 +01:00
picnixz
1cb52d5664
Improve traceback messages in parallel builds (#11452) 2023-07-23 21:33:57 +01:00
Adam Turner
ae866b1289 Avoid deprecated `Node.traverse method in test_node_translated_attribute` 2023-07-23 21:33:15 +01:00
danieleades
4de540efb6
Enable mypy 'strict optional' for 19 modules (#11422)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 21:29:04 +01:00
Manuel Kaufmann
f4a47f1401
Keep the `translated` attribute on translated nodes (#11502)
This particular commit ensures that the ``translated`` attribute
is retained on translated nodes so that developers may use it
to improve the experience on translations.
This attribute can be useful to calculate
the translated percentage of a particular document,
to visually mark paragraphs as not translated,
and many other applications.
2023-07-23 21:00:24 +01:00
danieleades
d564a8ba11
shrink mypy whitelist for `sphinx.builders` (#11396)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 18:21:29 +01:00
danieleades
edd9ea0a39
shrink whitelist for `sphinx.ext.autodoc.type_comment` (#11400)
Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
2023-07-23 17:49:18 +01:00
danieleades
f06ef37017
shrink mypy whitelist for `sphinx.application` (#11395)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 17:47:01 +01:00
danieleades
554d2eb399
shrink mypy whitelist for `sphinx.environment.adapters.indexentries` (#11421) 2023-07-23 17:26:12 +01:00
picnixz
12e7cff0b6
Allow using `rst_prolog` with a role in a document title (#11445)
Fix the field list field name recognition regular expression to avoid false positives,
as interpreted text roles may not be field name blocks.

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 17:14:01 +01:00
James Addison
c583e0f9b0
Add client connection-pool contention coverage to the `linkcheck` tests (#11402)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-07-23 16:24:12 +01:00
James Addison
2b333265cb
Add a connection-count measurement to the `linkcheck` tests (#11374) 2023-07-23 16:06:23 +01:00
James Addison
71db08c051
Style refactoring in the `linkcheck` builder (#11501)
- Omit a variable that is unused aside from a ``return`` statement on the subsequent line.
- Extract a variable for readability, and to reduce the complexity of a line.
2023-07-23 14:31:09 +01:00
Adam Turner
aabcda94cf
Add more information for the `test_gettext_dont_rebuild_mo` test (#11500) 2023-07-23 00:32:27 +01:00
Adam Turner
d71c781187
Re-structure the `linkcheck` builder (#11499)
Re-organise and re-structure the ``linkcheck`` builder:

- All functions defined within functions are factored out into top-level functions or class methods
- Classes and methods have been re-arranged (Builder, PostTransform, Checker, Worker)
- TLS verification on ``sphinx.util.requests`` has been changed to not pass the ``Config`` object all the way down
- The ``Hyperlink`` object now stores the document path
- ``BuildEnvironment`` and ``Config`` objects are used to extract properties and are not stored as class attributes
2023-07-23 00:01:41 +01:00
James Addison
566e4e74a0
Use HTTP/1.1 in linkcheck test webservers (#11392) 2023-07-22 20:12:32 +01:00
James Addison
bef7fc2e45
Refactor HTTP handlers in `linkcheck` builder tests (#11426) 2023-07-20 22:20:53 +01:00
Martin Liška
1b08535078
Clear `docutils.conf in SphinxTestApp.cleanup()` (#11345)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-07-20 22:03:42 +01:00
Adam Turner
ce140e8155 Introduce artificial delay into `test_gettext_dont_rebuild_mo` 2023-07-20 21:51:08 +01:00
James Addison
13720de50c
Treat SSL failures as broken links in the linkcheck builder (#11431)
TLS operates at a lower layer than HTTP, and so if there is a TLS-related error from a host,
it seems unlikely that retrying with a different higher-layer protocol request
(HTTP GET instead of HTTP HEAD) could succeed.
We should not make additional HTTP requests that we do not believe will succeed.
2023-07-20 21:38:21 +01:00
James Addison
e45fb5e61b
Reduce the lifetime of `response` in the linkcheck builder (#11432)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-20 21:14:00 +01:00
James Addison
ecc8613fc4
Use microsecond-resolution timestamps for outdated file detection (#11435)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-20 20:06:53 +01:00
chrysle
d6f10904a3
Document `--no-color and --color options to sphinx-build` (#11443) 2023-07-20 18:19:14 +01:00
Henry Schreiner
cc78e2a8d8
Provide timezone information in `datetime.fromtimestamp` (#11468)
Python 3.12 has deprecated ``datetime.utcfromtimestamp``.
Resolve the warning by working out ``tzdelta`` via explicit timezone calculations.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-07-20 18:14:18 +01:00
picnixz
037b6194d1
Use RFC 8081 font file MIME types in the EPUB builder (#11486)
The "font" top-level media type was formalised via :rfc:`8081` in 2017.
Standard MIME types for OTF and TTF fonts have been
`registered with IANA`_ as ``font/otf`` and ``font/ttf``.
These are also listed in the EPUB 3 `core media types`_ specification.

Sphinx-generated EPUB documents including custom OTF or TTF fonts
specify a MIME type for those fonts in ``content.opf`` of
``application/x-font-otf`` or ``application/x-font-ttf`` respectively.

The ``epubcheck`` application presents informational warnings that
these MIME types are non-standard when checking such a generated
EPUB document.
Adding the correct MIME type will prevent those messages
and will also result in a valid EPUB.

.. _core media types: https://www.w3.org/TR/epub/#sec-core-media-types
.. _registered with IANA: https://www.iana.org/assignments/media-types/media-types.xhtml#font
2023-07-20 18:07:43 +01:00
Adam Turner
571becb6af Re-instate the footnote-reference class 2023-07-14 07:50:12 +01:00
Adam Turner
0858c3b841 Resolve `mypy` warnings 2023-07-14 07:06:46 +01:00
Adam Turner
7c8eda24a1 Resolve `sphinx-lint` warnings 2023-07-14 06:55:18 +01:00
Adam Turner
de3aa8a318 Replace non-functional Bitbucket URLs
- ``sphinx-contrib`` has moved to GitHub
- Replace personal project links with links to the Bitbucket archive
2023-07-14 06:52:25 +01:00
Adam Turner
d3c91f9512 Refactor `status_iterator` 2023-05-15 10:43:55 +01:00
Adam Turner
d8d7fed993 Don't add colours to messagelog
We need to remove colours later for display, so it is pointless to add them.
2023-05-15 10:20:31 +01:00
Adam Turner
00eeea3d9b Simplify `make clean` 2023-05-13 01:17:35 +01:00
danieleades
31759d6b08
Expand the mypy whitelist for 'sphinx.util' (#11406) 2023-05-12 23:51:59 +01:00
danieleades
1c5158e010
Remove 'sphinx.ext.duration' from the mypy whitelist (#11404) 2023-05-12 23:50:44 +01:00