Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5fe7650

Browse filesBrowse files
[3.13] GH-125722: Increase minimum supported Sphinx to 8.1.3 (GH-128922) (#129037)
(cherry picked from commit d46b577) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 080d17e commit 5fe7650
Copy full SHA for 5fe7650

File tree

Expand file treeCollapse file tree

7 files changed

+14
-100
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+14
-100
lines changed

‎.github/workflows/reusable-docs.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-docs.yml
-20Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,6 @@ jobs:
7676
--fail-if-improved \
7777
--fail-if-new-news-nit
7878
79-
# This build doesn't use problem matchers or check annotations
80-
build_doc_oldest_supported_sphinx:
81-
name: 'Docs (Oldest Sphinx)'
82-
runs-on: ubuntu-latest
83-
timeout-minutes: 60
84-
steps:
85-
- uses: actions/checkout@v4
86-
with:
87-
persist-credentials: false
88-
- name: 'Set up Python'
89-
uses: actions/setup-python@v5
90-
with:
91-
python-version: '3.13' # known to work with Sphinx 7.2.6
92-
cache: 'pip'
93-
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
94-
- name: 'Install build dependencies'
95-
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
96-
- name: 'Build HTML documentation'
97-
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
98-
9979
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
10080
doctest:
10181
name: 'Doctest'

‎Doc/conf.py

Copy file name to clipboardExpand all lines: Doc/conf.py
+4-25Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
import importlib
1010
import os
1111
import sys
12-
import time
13-
14-
import sphinx
1512

1613
# Make our custom extensions available to Sphinx
1714
sys.path.append(os.path.abspath('tools/extensions'))
@@ -67,10 +64,7 @@
6764

6865
# General substitutions.
6966
project = 'Python'
70-
if sphinx.version_info[:2] >= (8, 1):
71-
copyright = "2001-%Y, Python Software Foundation"
72-
else:
73-
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
67+
copyright = "2001-%Y, Python Software Foundation"
7468

7569
# We look for the Include/patchlevel.h file in the current Python source tree
7670
# and replace the values accordingly.
@@ -93,7 +87,8 @@
9387
highlight_language = 'python3'
9488

9589
# Minimum version of sphinx required
96-
needs_sphinx = '7.2.6'
90+
# Keep this version in sync with ``Doc/requirements.txt``.
91+
needs_sphinx = '8.1.3'
9792

9893
# Create table of contents entries for domain objects (e.g. functions, classes,
9994
# attributes, etc.). Default is True.
@@ -372,13 +367,7 @@
372367

373368
# This 'Last updated on:' timestamp is inserted at the bottom of every page.
374369
html_last_updated_fmt = '%b %d, %Y (%H:%M UTC)'
375-
if sphinx.version_info[:2] >= (8, 1):
376-
html_last_updated_use_utc = True
377-
else:
378-
html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
379-
html_last_updated_fmt = time.strftime(
380-
html_last_updated_fmt, time.gmtime(html_time)
381-
)
370+
html_last_updated_use_utc = True
382371

383372
# Path to find HTML templates to override theme
384373
templates_path = ['tools/templates']
@@ -615,16 +604,6 @@
615604
}
616605
extlinks_detect_hardcoded_links = True
617606

618-
if sphinx.version_info[:2] < (8, 1):
619-
# Sphinx 8.1 has in-built CVE and CWE roles.
620-
extlinks |= {
621-
"cve": (
622-
"https://www.cve.org/CVERecord?id=CVE-%s",
623-
"CVE-%s",
624-
),
625-
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
626-
}
627-
628607
# Options for c_annotations extension
629608
# -----------------------------------
630609

‎Doc/constraints.txt

Copy file name to clipboardExpand all lines: Doc/constraints.txt
+6-8Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ packaging<25
1313
Pygments<3
1414
requests<3
1515
snowballstemmer<3
16-
# keep lower-bounds until Sphinx 8.1 is released
17-
# https://github.com/sphinx-doc/sphinx/pull/12756
18-
sphinxcontrib-applehelp>=1.0.7,<3
19-
sphinxcontrib-devhelp>=1.0.6,<3
20-
sphinxcontrib-htmlhelp>=2.0.6,<3
21-
sphinxcontrib-jsmath>=1.0.1,<2
22-
sphinxcontrib-qthelp>=1.0.6,<3
23-
sphinxcontrib-serializinghtml>=1.1.9,<3
16+
sphinxcontrib-applehelp<3
17+
sphinxcontrib-devhelp<3
18+
sphinxcontrib-htmlhelp<3
19+
sphinxcontrib-jsmath<2
20+
sphinxcontrib-qthelp<3
21+
sphinxcontrib-serializinghtml<3
2422

2523
# Direct dependencies of Jinja2 (Jinja is a dependency of Sphinx, see above)
2624
MarkupSafe<3

‎Doc/requirements-oldest-sphinx.txt

Copy file name to clipboardExpand all lines: Doc/requirements-oldest-sphinx.txt
-35Lines changed: 0 additions & 35 deletions
This file was deleted.

‎Doc/requirements.txt

Copy file name to clipboardExpand all lines: Doc/requirements.txt
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
# Note that when updating this file, you will likely also have to update
44
# the Doc/constraints.txt file.
55

6-
# Sphinx version is pinned so that new versions that introduce new warnings
6+
# The Sphinx version is pinned so that new versions that introduce new warnings
77
# won't suddenly cause build failures. Updating the version is fine as long
88
# as no warnings are raised by doing so.
9+
# Keep this version in sync with ``Doc/conf.py``.
910
sphinx~=8.1.0
1011

1112
blurb

‎Doc/tools/extensions/c_annotations.py

Copy file name to clipboardExpand all lines: Doc/tools/extensions/c_annotations.py
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from pathlib import Path
1717
from typing import TYPE_CHECKING
1818

19-
import sphinx
2019
from docutils import nodes
2120
from docutils.statemachine import StringList
2221
from sphinx import addnodes
@@ -285,16 +284,6 @@ def setup(app: Sphinx) -> ExtensionMetadata:
285284
app.connect("builder-inited", init_annotations)
286285
app.connect("doctree-read", add_annotations)
287286

288-
if sphinx.version_info[:2] < (7, 2):
289-
from docutils.parsers.rst import directives
290-
from sphinx.domains.c import CObject
291-
292-
# monkey-patch C object...
293-
CObject.option_spec |= {
294-
"no-index-entry": directives.flag,
295-
"no-contents-entry": directives.flag,
296-
}
297-
298287
return {
299288
"version": "1.0",
300289
"parallel_read_safe": True,
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Require Sphinx 8.1.3 or later to build the Python documentation. Patch by
2+
Adam Turner.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.