Commit Graph

20149 Commits

Author SHA1 Message Date
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
danieleades
2c58722627
Remove 'sphinx.util.typing' from mypy whitelist (#11397) 2023-05-12 23:48:07 +01:00
Adam Turner
343e149398 Merge branch '7.0.x'
# Conflicts:
#	CHANGES
#	sphinx/__init__.py
2023-05-12 22:57:09 +01:00
Adam Turner
d48cc783b6 Bump to 7.0.1 final 2023-05-12 22:48:41 +01:00
Willem
de6b18ac7d
Remove remaining references to the setuptools integration (#11418)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-12 22:46:17 +01:00
Adam Turner
749af9561e Bump version 2023-05-12 13:57:37 +01:00
Jean-François B
53b9b28366 Update CHANGEs 2023-05-12 12:00:22 +02:00
Stefanie Molin
e09d02e440
Allow `copyright` to contain multiple entries (#10983)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-11 22:43:48 +01:00
TLouf
86b07d4a97
Allow multi-line object description signatures (#11011)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com>
Co-authored-by: TLouf <loufthomas@gmail.com>
2023-05-11 14:28:57 +01:00
Adam Turner
c73628dfca Accept a version tuple in `app.require_sphinx()` 2023-05-11 13:50:45 +01:00
Adam Turner
ae206694e6
html builder: Append CRC32 checksum to asset URIs (#11415) 2023-05-11 05:19:31 +01:00
Adam Turner
706f5f9cc8
Warn on deprecated Python-specific index types (#11412) 2023-05-09 22:57:39 +01:00
Adam Turner
db546189ce
Support Docutils 0.20 (#11411) 2023-05-09 21:00:04 +01:00
Adam Turner
8942a1dddf Test with Docutils 0.20 2023-05-09 19:24:18 +01:00
James Addison
c9d0933e5d
linkcheck: Use context managers for HTTP requests (#11318)
This closes HTTP responses when no content reads are required, as
when requests are made in streaming mode, ``requests`` doesn't know
whether the caller may intend to later read content from a streamed
HTTP response object and holds the socket open.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-09 17:09:35 +01:00
Adam Turner
2b1c106bbf Update documentation workflow
- Add 'workflow_dispatch' target
- Force output to use colour
- Print traceback on error
- Use parallel building
2023-05-09 16:51:52 +01:00
Adam Turner
ba7408209e Change concurrency groups for GitHub workflows
This means that 'push' triggered workflows are not cancelled.
2023-04-29 22:44:55 +01:00
Adam Turner
b546879539 Bump version 2023-04-29 22:26:43 +01:00