Skip to content

Use the latest Sphinx version #125722

Closed
Closed
@AA-Turner

Description

@AA-Turner

Documentation

Python's documentation uses the Sphinx toolchain. Originally written for the Python documentation, it is now developed and distributed as an independent project. The two remain closely linked, e.g. when new syntax is added to the Python language. To document this syntax in the best way, Sphinx must support it and Python must require a version of Sphinx that supports the syntax.

Using the new syntax in PEP-695 as an example:

  1. The implementation was committed on 16 May (gh-103763: Implement PEP 695 #103764)
  2. The first draft of the documentation was written on 19 May (gh-103921: Document PEP 695 #104642)
  3. A feature request was created in Sphinx on 23 May (Support PEP 695 syntax for class definitions sphinx-doc/sphinx#11438)
  4. Sphinx added support on 23 July (Support PEP 695 and PEP 696 syntax in py:function and py:class directives. sphinx-doc/sphinx#11444)
  5. Sphinx published a release with support on 24 July (v7.1.0)
  6. The Python project can use those features, 19 October [+ 1 year] (GH-125277: Increase minimum supported Sphinx to 7.2.6 #125368)

This is a ~two month window from implementation to support in a release of Sphinx. It took a further 15 months and two feature releases (3.12, 3.13) until these features can be used in Python. Due to this, our documentation is meaningfully worse for readers and programmers. Using older versions of Sphinx mean that we cannot succinctly cover the features and syntax that exist within released versions of Python.

Core developers responsible for these features have expressed interest, but have been hampered by our self-imposed restriction of the minimum version of Sphinx that we support.

We adopt these restrictions for the benefit of downstream Linux redistributors, as can be seen in the more recent issues in the summary table below. This has not always been the case. From the adoption of Sphinx in 2007 (8ec7f65 / 116aa62) until 2014 (f7b2f36), the latest source-tree checkout of Sphinx at https://svn.python.org/ was used. From then until ~2018 the minimum required Sphinx version (controlled by needs_sphinx in conf.py) tracked the latest release promptly. This has since ossified.

In a recent informal discussion, several committers supported the idea of removing or relaxing this restriction, allowing the Python documentation to use the latest version(s) of Sphinx. This is the context for this note, which for now is a proposal. The status quo will prevail if there is not sufficient support.

As a concrete suggestion, I propose that when evaulating increasing the minimum required version of Sphinx, we no longer consult downstream redistributors' Sphinx versions. The procedure will follow standard Python development processes in all other ways. I expect that the minimum version would be updated if and when a new Sphinx feature is of sufficient benefit to Python. This, though, may be a greater version than a downstream redistributor provides.

We would like to solicit views from representatives of downstream redistributors as to how (in)feasible this proposal would be. My understanding is that Fedora and SUSE have processes whereby a newer version of Sphinx can be used soley for the Python documentation. I do not know how this will impact Debian or Gentoo.

Thank you in advance for your consideration,
Adam

Table of past changes to needs_sphinx

needs_sphinx Issue PR / Commit Latest Sphinx 1
7.2.6 #125277 #125368 8.1.3
6.2.1 #117928 #121986 7.4.6
4.2 #109209 #109210 7.2.6
3.2 #86986 #93337 5.0.1
1.8 #80188 #11887 1.8.4
1.7 doc-sig #9423 1.8.1
1.2 #65630 90d76ca 1.2.3
1.1 #64860 f7b2f36 1.2.1

Previous discussion relating to the minumum version:

cc:

Linked PRs

Footnotes

  1. At commit date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions