From 8256092f1475d1aa40ad088147a0a4c652eb6d52 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:00:08 +0000 Subject: [PATCH] Retarget to Sphinx 9.0 (#14093) --- CHANGES.rst | 4 ++-- doc/usage/configuration.rst | 8 ++++---- doc/usage/extensions/autodoc.rst | 4 ++-- doc/usage/extensions/doctest.rst | 2 +- doc/usage/extensions/math.rst | 2 +- doc/usage/restructuredtext/directives.rst | 14 +++++++------- sphinx/__init__.py | 4 ++-- sphinx/texinputs/sphinx.sty | 8 ++++---- sphinx/texinputs/sphinxlatexadmonitions.sty | 4 ++-- sphinx/texinputs/sphinxlatexliterals.sty | 2 +- sphinx/texinputs/sphinxlatexstyletext.sty | 2 +- sphinx/texinputs/sphinxlatextables.sty | 12 ++++++------ sphinx/texinputs/sphinxpackagefootnote.sty | 2 +- sphinx/writers/latex.py | 2 +- 14 files changed, 35 insertions(+), 35 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 378f15c0e9..5244ed4f07 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,4 +1,4 @@ -Release 8.3.0 (in development) +Release 9.0.0 (in development) ============================== Dependencies @@ -18,7 +18,7 @@ Incompatible changes and there may be some incompatible changes in edge cases, especially when extensions interact with autodoc internals. The :confval:`autodoc_use_legacy_class_based` option has been added to - use the legacy (pre-8.3) implementation of autodoc. + use the legacy (pre-9.0) implementation of autodoc. Patches by Adam Turner. Deprecated diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index e9f4d37c1d..78d739a005 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -1157,9 +1157,9 @@ Options for source files The recommended encoding is ``'utf-8-sig'``. .. versionadded:: 0.5 - .. deprecated:: 8.3 + .. deprecated:: 9.0 Support for source encodings other than UTF-8 is deprecated. - Sphinx 10 will only support UTF-8 files. + Sphinx 11 will only support UTF-8 files. .. confval:: source_suffix :type: :code-py:`dict[str, str] | Sequence[str] | str` @@ -3671,7 +3671,7 @@ and which failures and redirects it ignores. .. versionadded:: 4.1 - .. versionchanged:: 8.3 + .. versionchanged:: 9.0 Setting :confval:`!linkcheck_allowed_redirects` to an empty dictionary may now be used to warn on all redirects encountered by the *linkcheck* builder. @@ -3847,7 +3847,7 @@ and the number of workers to use. .. note:: URI fragments (HTML anchors) are not affected by this option. They are always checked with case-sensitive comparisons. - .. versionadded:: 8.3 + .. versionadded:: 9.0 .. confval:: linkcheck_rate_limit_timeout :type: :code-py:`int` diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst index 1aa87c8e50..926bbc5e77 100644 --- a/doc/usage/extensions/autodoc.rst +++ b/doc/usage/extensions/autodoc.rst @@ -971,7 +971,7 @@ Automatically document type aliases .. rst:directive:: autotype - .. versionadded:: 8.3 + .. versionadded:: 9.0 Document a :pep:`695` type alias (the :keyword:`type` statement). By default, the directive only inserts the docstring of the alias itself: @@ -1008,7 +1008,7 @@ There are also config values that you can set: :default: :code-py:`False` If true, autodoc will use the legacy class-based implementation. - This is the behaviour prior to Sphinx 8.3. + This is the behaviour prior to Sphinx 9.0. It is based on the ``Documenter`` class hierarchy. This setting is provided for backwards compatibility if your documentation diff --git a/doc/usage/extensions/doctest.rst b/doc/usage/extensions/doctest.rst index 10e8f67dfe..d6ba139088 100644 --- a/doc/usage/extensions/doctest.rst +++ b/doc/usage/extensions/doctest.rst @@ -459,4 +459,4 @@ The doctest extension uses the following configuration values: Exit when the first failure is encountered. - .. versionadded:: 8.3 + .. versionadded:: 9.0 diff --git a/doc/usage/extensions/math.rst b/doc/usage/extensions/math.rst index f39aaa24fd..79ec7bbe32 100644 --- a/doc/usage/extensions/math.rst +++ b/doc/usage/extensions/math.rst @@ -346,7 +346,7 @@ Sphinx but is set to automatically include it from a third-party site. __ https://docs.mathjax.org/en/latest/web/configuration.html#configuration - .. versionadded:: 8.3 + .. versionadded:: 9.0 :mod:`sphinxcontrib.jsmath` -- Render math via JavaScript --------------------------------------------------------- diff --git a/doc/usage/restructuredtext/directives.rst b/doc/usage/restructuredtext/directives.rst index 92b24306e8..4b0d9d128e 100644 --- a/doc/usage/restructuredtext/directives.rst +++ b/doc/usage/restructuredtext/directives.rst @@ -552,7 +552,7 @@ Describing changes between versions There must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. - .. version-changed:: 8.3 + .. version-changed:: 9.0 The :rst:dir:`versionadded` directive was renamed to :rst:dir:`version-added`. The previous name is retained as an alias. @@ -570,7 +570,7 @@ Describing changes between versions Similar to :rst:dir:`version-added`, but describes when and what changed in the named feature in some way (new parameters, changed side effects, etc.). - .. version-changed:: 8.3 + .. version-changed:: 9.0 The :rst:dir:`versionchanged` directive was renamed to :rst:dir:`version-changed`. The previous name is retained as an alias. @@ -590,7 +590,7 @@ Describing changes between versions A *brief* explanation can also be given, for example to tell the reader what to use instead. - .. version-changed:: 8.3 + .. version-changed:: 9.0 The :rst:dir:`deprecated` directive was renamed to :rst:dir:`version-deprecated`. The previous name is retained as an alias @@ -611,7 +611,7 @@ Describing changes between versions .. version-added:: 7.3 - .. version-changed:: 8.3 + .. version-changed:: 9.0 The :rst:dir:`versionremoved` directive was renamed to :rst:dir:`version-removed`. The previous name is retained as an alias. @@ -1492,7 +1492,7 @@ Check the :confval:`latex_table_style`. complex contents such as multiple paragraphs, blockquotes, lists, literal blocks, will render correctly to LaTeX output. -.. versionchanged:: 8.3.0 +.. versionchanged:: 9.0 The partial support of the LaTeX builder for nesting a table in another has been extended. Formerly Sphinx would raise an error if ``longtable`` class was specified @@ -1579,12 +1579,12 @@ Check the :confval:`latex_table_style`. preamble, as in fact Sphinx uses ``T`` and sets it by default to be an alias of ``J``. -.. versionchanged:: 8.3.0 +.. versionchanged:: 9.0 Formerly, Sphinx did not use ``tabulary`` if the table had at least one cell containing "problematic" elements such as lists, object descriptions, blockquotes (etc...) because such contents are not out-of-the-box - compatible with ``tabulary``. At ``8.3.0`` a technique, which was already + compatible with ``tabulary``. At ``9.0`` a technique, which was already in use for merged cells, was extended to such cases, and the sole "problematic" contents are code-blocks and nested tables. So tables containing (only) cells with multiple paragraphs, bullet or enumerated diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 79df3e09df..17a020e534 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -11,7 +11,7 @@ TYPE_CHECKING = False if TYPE_CHECKING: from typing import Final -__version__: Final = '8.3.0' +__version__: Final = '9.0.0' __display_version__: Final = __version__ # used for command line version #: Version info for better programmatic use. @@ -22,7 +22,7 @@ __display_version__: Final = __version__ # used for command line version #: #: .. versionadded:: 1.2 #: Before version 1.2, check the string ``sphinx.__version__``. -version_info: Final = (8, 3, 0, 'beta', 0) +version_info: Final = (9, 0, 0, 'beta', 0) package_dir: Final = _StrPath(__file__).resolve().parent del _StrPath diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 109c07d1a9..769e6b9725 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -9,7 +9,7 @@ % by the Sphinx LaTeX writer. \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{sphinx}[2025/08/03 v8.3.0 Sphinx LaTeX package (sphinx-doc)] +\ProvidesPackage{sphinx}[2025/08/03 v9.0.0 Sphinx LaTeX package (sphinx-doc)] % provides \ltx@ifundefined % (many packages load ltxcmds: graphicx does for pdftex and lualatex but @@ -872,8 +872,8 @@ % % We let Sphinx use, listed in order of priority: % - a user-specified package via iconpackage key, -% - fontawesome7 (supported since 8.3.0), -% - fontawesome6 (supported since 8.3.0), +% - fontawesome7 (supported since 9.0.0), +% - fontawesome6 (supported since 9.0.0), % - fontawesome5, % - fontawesome, % - or nothing at all, and then icons are not drawn. @@ -904,7 +904,7 @@ }% % Unfortunately icon macro names are not the same across fontawesome, % fontawesome5, fontawesome6 and fontawesome7 LaTeX packages. -% At 8.3.0 we refactor the +% At 9.0.0 we refactor the % icon support code into something easier to maintain in future in case of a % fontawesome8, etc... % diff --git a/sphinx/texinputs/sphinxlatexadmonitions.sty b/sphinx/texinputs/sphinxlatexadmonitions.sty index 6b2d45779a..dd3145d8a7 100644 --- a/sphinx/texinputs/sphinxlatexadmonitions.sty +++ b/sphinx/texinputs/sphinxlatexadmonitions.sty @@ -1,7 +1,7 @@ %% NOTICES AND ADMONITIONS % % change this info string if making any custom modification -\ProvidesPackage{sphinxlatexadmonitions}[2025/10/24 v8.3.0 admonitions] +\ProvidesPackage{sphinxlatexadmonitions}[2025/10/24 v9.0.0 admonitions] % Provides support for this output mark-up from Sphinx latex writer: % @@ -109,7 +109,7 @@ % Code adapted from framed.sty's "snugshade" environment. % Nesting works (inner frames do not allow page breaks). % -% At 8.3.0, avoid admonition title getting separated from contents at a +% At 9.0, avoid admonition title getting separated from contents at a % page break. \newcommand\sphinxheavyboxneedspacecommand{\needspace{5\baselineskip}} \newenvironment{sphinxheavybox}{\par diff --git a/sphinx/texinputs/sphinxlatexliterals.sty b/sphinx/texinputs/sphinxlatexliterals.sty index 8b0036b464..b0f349720a 100644 --- a/sphinx/texinputs/sphinxlatexliterals.sty +++ b/sphinx/texinputs/sphinxlatexliterals.sty @@ -1,7 +1,7 @@ %% LITERAL BLOCKS % % change this info string if making any custom modification -\ProvidesPackage{sphinxlatexliterals}[2025/08/06 v8.3.0 code-blocks and parsed literals] +\ProvidesPackage{sphinxlatexliterals}[2025/08/06 v9.0.0 code-blocks and parsed literals] % Provides support for this output mark-up from Sphinx latex writer: % diff --git a/sphinx/texinputs/sphinxlatexstyletext.sty b/sphinx/texinputs/sphinxlatexstyletext.sty index 6c80ce64b4..b6408cfb21 100644 --- a/sphinx/texinputs/sphinxlatexstyletext.sty +++ b/sphinx/texinputs/sphinxlatexstyletext.sty @@ -1,7 +1,7 @@ %% TEXT STYLING % % change this info string if making any custom modification -\ProvidesPackage{sphinxlatexstyletext}[2025/05/24 v8.3.0 text styling] +\ProvidesPackage{sphinxlatexstyletext}[2025/05/24 v9.0.0 text styling] % 7.4.0 has moved all that is related to admonitions to sphinxlatexadmonitions.sty % 8.1.0 has moved topic/contents/sidebar to sphinxlatexshadowbox.sty diff --git a/sphinx/texinputs/sphinxlatextables.sty b/sphinx/texinputs/sphinxlatextables.sty index 8320ef31cf..9c9bb74de0 100644 --- a/sphinx/texinputs/sphinxlatextables.sty +++ b/sphinx/texinputs/sphinxlatextables.sty @@ -1,7 +1,7 @@ %% TABLES (WITH SUPPORT FOR MERGED CELLS OF GENERAL CONTENTS) % % change this info string if making any custom modification -\ProvidesPackage{sphinxlatextables}[2025/06/30 v8.3.0 tables]% +\ProvidesPackage{sphinxlatextables}[2025/06/30 v9.0.0 tables]% % Provides support for this output mark-up from Sphinx latex writer % and table templates: @@ -44,7 +44,7 @@ % - \sphinxthistablewithnovlinesstyle % - \sphinxbeforeendvarwidth -% At 8.3.0, ALL table cell contents are wrapped into a varwidth environment. +% At 9.0, ALL table cell contents are wrapped into a varwidth environment. % This helps solve issues such as #3447, #8828, and helps use tabulary % in many more cases hence obtain better looking tables. \def\sphinxbeforeendvarwidth{\par\vskip-\baselineskip\hbox{\strut}} @@ -53,12 +53,12 @@ % standard "depth". Else it may lack any depth if without descenders such as % "p" or "q" letters and the horizontal line or color panel will look strange. % It originates in PR #3435 from 2017 which solved *many* table issues for -% merged cells (and injected the varwidth technique now at 8.3.0 applied to +% merged cells (and injected the varwidth technique now at 9.0 applied to % all cells). The original used \vbox{\hbox{\strut}} but that \vbox appears % to do nothing, and it was decided after some testing (July 2025) to remove % it, the original rationale for it being now lost. -% These conditionals added at 8.3.0 for nested tables not to break row colors +% These conditionals added at 9.0 for nested tables not to break row colors % (#13635). Nested tables are only partially supported by Sphinx LaTeX. % The method here is with no changes to neither writer nor templates. \newif\ifspx@intable @@ -273,11 +273,11 @@ % them and compare their relative importance. Its goal is to choose the % column width so that, roughly, all columns will look about evenly % filled. "Horizontal" rendering is incompatible with many LaTeX -% structures such as lists, so prior to Sphinx 8.3.0 cells with such +% structures such as lists, so prior to Sphinx 9.0 cells with such % "problematic" contents caused Sphinx to use tabular not tabulary; the % tabular would then render each column in absence of :widths: option or % tabularcolumns directive the same width equal to available text width -% divided by number of columns. At 8.3.0, "problematic" contents is +% divided by number of columns. At 9.0, "problematic" contents is % wrapped into a "varwidth" environment, as was already done formerly % for merged cells, and this avoids tabulary causing errors such as % "incompatible with LR mode"; \sphinxcolwidth is used which sets diff --git a/sphinx/texinputs/sphinxpackagefootnote.sty b/sphinx/texinputs/sphinxpackagefootnote.sty index 1bde37f104..f68bcf3880 100644 --- a/sphinx/texinputs/sphinxpackagefootnote.sty +++ b/sphinx/texinputs/sphinxpackagefootnote.sty @@ -1,6 +1,6 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{sphinxpackagefootnote}% - [2025/11/15 v8.3.0 Sphinx custom footnotehyper package (Sphinx team)] + [2025/11/15 v9.0.0 Sphinx custom footnotehyper package (Sphinx team)] %% %% Package: sphinxpackagefootnote %% Version: based on footnotehyper.sty 2021/02/04 v1.1d diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index f92f983fbe..1d0c4b60de 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1365,7 +1365,7 @@ class LaTeXTranslator(SphinxTranslator): r'\sphinxmultirow{%d}{%d}{%%' % (cell.height, cell.cell_id) + CR ) context = '}%' + CR + context - # 8.3.0 wraps ALL cells contents in "varwidth". This fixes a + # 9.0 wraps ALL cells contents in "varwidth". This fixes a # number of issues and allows more usage of tabulary. # # "varwidth" usage allows a *tight fit* to multiple paragraphs,