diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index ec900ce68a1dde..e86a20b89a4c16 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -93,7 +93,7 @@ jobs: - name: 'Set up Python' uses: actions/setup-python@v4 with: - python-version: '3.11' # known to work with Sphinx 3.2 + python-version: '3.11' # known to work with Sphinx 6.2.1 cache: 'pip' cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt' - name: 'Install build dependencies' diff --git a/Doc/conf.py b/Doc/conf.py index 485c0bdf84df2e..bae624ea236d06 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -65,8 +65,9 @@ # By default, highlight as Python 3. highlight_language = 'python3' -# Minimum version of sphinx required -needs_sphinx = '3.2' +# Minimum version of sphinx required. +# Sphinx 6.2 no longer uses imghdr which was removed in Python 3.13. +needs_sphinx = '6.2' # Ignore any .rst files in the includes/ directory; # they're embedded in pages but not rendered individually. diff --git a/Doc/requirements-oldest-sphinx.txt b/Doc/requirements-oldest-sphinx.txt index d0390a04ea6dd8..a62f0c04959e1e 100644 --- a/Doc/requirements-oldest-sphinx.txt +++ b/Doc/requirements-oldest-sphinx.txt @@ -7,32 +7,29 @@ blurb python-docs-theme>=2022.1 # Generated from: -# pip install "Sphinx~=3.2.0" "docutils<0.17" "Jinja2<3" "MarkupSafe<2" +# pip install "Sphinx==6.2.0" # pip freeze # -# Sphinx 3.2 comes from ``needs_sphinx = '3.2'`` in ``Doc/conf.py``. -# Docutils<0.17, Jinja2<3, and MarkupSafe<2 are additionally specified as -# Sphinx 3.2 is incompatible with newer releases of these packages. +# Sphinx 6.2 comes from ``needs_sphinx = '6.2'`` in ``Doc/conf.py``. -Sphinx==3.2.1 alabaster==0.7.13 Babel==2.12.1 -certifi==2022.12.7 +certifi==2023.5.7 charset-normalizer==3.1.0 -colorama==0.4.6 -docutils==0.16 +docutils==0.19 idna==3.4 imagesize==1.4.1 -Jinja2==2.11.3 -MarkupSafe==1.1.1 +Jinja2==3.1.2 +MarkupSafe==2.1.2 packaging==23.1 Pygments==2.15.1 -requests==2.29.0 +requests==2.31.0 snowballstemmer==2.2.0 +Sphinx==6.2.0 sphinxcontrib-applehelp==1.0.4 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 -urllib3==1.26.15 +urllib3==2.0.2 diff --git a/Doc/requirements.txt b/Doc/requirements.txt index 9cbd15c2209dc6..d49c2fa55a5f15 100644 --- a/Doc/requirements.txt +++ b/Doc/requirements.txt @@ -6,7 +6,7 @@ # Sphinx version is pinned so that new versions that introduce new warnings # won't suddenly cause build failures. Updating the version is fine as long # as no warnings are raised by doing so. -sphinx==4.5.0 +sphinx==6.2.1 blurb diff --git a/Doc/tools/extensions/c_annotations.py b/Doc/tools/extensions/c_annotations.py index 3551bfa4c0f133..818b0de19d694c 100644 --- a/Doc/tools/extensions/c_annotations.py +++ b/Doc/tools/extensions/c_annotations.py @@ -42,16 +42,6 @@ } -# Monkeypatch nodes.Node.findall for forwards compatability -# This patch can be dropped when the minimum Sphinx version is 4.4.0 -# or the minimum Docutils version is 0.18.1. -if docutils.__version_info__ < (0, 18, 1): - def findall(self, *args, **kwargs): - return iter(self.traverse(*args, **kwargs)) - - nodes.Node.findall = findall - - class RCEntry: def __init__(self, name): self.name = name diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index fbe280d6413170..c284d645c29fe8 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -22,6 +22,8 @@ Features required to build CPython: * On Windows, Microsoft Visual Studio 2017 or later is required. +* Sphinx 6.2 or newer is required to build the Python documentation. + .. versionchanged:: 3.11 C11 compiler, IEEE 754 and NaN support are now required. On Windows, Visual Studio 2017 or later is required. diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 8734dd89513a11..393c88fc8c9b6c 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -241,6 +241,11 @@ that may require changes to your code. Build Changes ============= +* Sphinx 6.2 or newer is now required to build the Python documentation. + Sphinx 6.2 no longer uses the :mod:`!imghdr` module which was removed in + Python 3.13. + (Contributed by Victor Stinner in :gh:`104818`.) + C API Changes ============= diff --git a/Misc/NEWS.d/next/Build/2023-05-23-22-41-42.gh-issue-104818.8SI01U.rst b/Misc/NEWS.d/next/Build/2023-05-23-22-41-42.gh-issue-104818.8SI01U.rst new file mode 100644 index 00000000000000..212898c6195347 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-05-23-22-41-42.gh-issue-104818.8SI01U.rst @@ -0,0 +1,2 @@ +Sphinx 6.2 or newer is now required to build the Python documentation. Patch +by Victor Stinner.