diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a6be6694b..235f44ced1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,12 +42,12 @@ jobs: - "3.14" - "3.14t" docutils: - - "0.20" + - "0.21" - "0.22" - include: - # test every supported Docutils version for the latest supported Python - - python: "3.14" - docutils: "0.21" +# include: +# # test every supported Docutils version for the latest supported Python +# - python: "3.14" +# docutils: "0.21" steps: - uses: actions/checkout@v6 @@ -93,7 +93,7 @@ jobs: python: - "3.15" docutils: - - "0.20" + - "0.21" - "0.22" steps: diff --git a/CHANGES.rst b/CHANGES.rst index ebb9ea3bd9..6a3f076238 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ Dependencies ------------ * #14153: Drop Python 3.11 support. +* #12555: Drop Docutils 0.20 support. + Patch by Adam Turner Incompatible changes -------------------- diff --git a/pyproject.toml b/pyproject.toml index ee19720c6d..b26c3f2cd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,7 +75,7 @@ dependencies = [ "sphinxcontrib-serializinghtml>=1.1.9", "Jinja2>=3.1", "Pygments>=2.17", - "docutils>=0.20,<0.23", + "docutils>=0.21,<0.23", "snowballstemmer>=2.2", "babel>=2.13", "alabaster>=0.7.14", diff --git a/tests/test_builders/test_build_html_image.py b/tests/test_builders/test_build_html_image.py index 40e1b1cc42..6c25660280 100644 --- a/tests/test_builders/test_build_html_image.py +++ b/tests/test_builders/test_build_html_image.py @@ -75,12 +75,10 @@ def test_html_scaled_image_link(app: SphinxTestApp) -> None: context, ) else: - # Docutils 0.21 adds a newline before the closing tag - closing_space = '\n' if docutils.__version_info__[:2] >= (0, 21) else '' assert re.search( '\n' '_images/img.png' - f'{closing_space}', + '\n', context, ) diff --git a/tests/test_builders/test_build_linkcheck.py b/tests/test_builders/test_build_linkcheck.py index fdaf92ccd3..7b036ec450 100644 --- a/tests/test_builders/test_build_linkcheck.py +++ b/tests/test_builders/test_build_linkcheck.py @@ -15,7 +15,6 @@ from queue import Queue from typing import TYPE_CHECKING from unittest import mock -import docutils import pytest from urllib3.poolmanager import PoolManager @@ -177,11 +176,7 @@ def test_defaults(app: SphinxTestApp) -> None: 'info': f'404 Client Error: Not Found for url: http://{address}/{filename}', } - accurate_linenumbers = docutils.__version_info__[:2] >= (0, 21) - image2_lineno = 12 if accurate_linenumbers else 13 - assert rowsby[f'http://{address}/image2.png'] == _missing_resource( - 'image2.png', image2_lineno - ) + assert rowsby[f'http://{address}/image2.png'] == _missing_resource('image2.png', 12) # looking for '#top' and '#does-not-exist' not found should fail assert rowsby[f'http://{address}/#top']['info'] == "Anchor 'top' not found" assert rowsby[f'http://{address}/#top']['status'] == 'broken' diff --git a/tests/test_builders/test_build_manpage.py b/tests/test_builders/test_build_manpage.py index 7e796a1514..59ee10cccf 100644 --- a/tests/test_builders/test_build_manpage.py +++ b/tests/test_builders/test_build_manpage.py @@ -4,7 +4,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -import docutils import pytest from sphinx.builders.manpage import default_man_pages @@ -65,25 +64,7 @@ def test_captioned_code_block(app: SphinxTestApp) -> None: app.build(force_all=True) content = (app.outdir / 'projectnamenotset.1').read_text(encoding='utf8') - if docutils.__version_info__[:2] < (0, 21): - expected = """\ -.sp -caption \\fItest\\fP rb -.INDENT 0.0 -.INDENT 3.5 -.sp -.nf -.ft C -def ruby? - false -end -.ft P -.fi -.UNINDENT -.UNINDENT -""" - else: - expected = """\ + expected = """\ .sp caption \\fItest\\fP rb .INDENT 0.0 diff --git a/uv.lock b/uv.lock index 6d6a05dbd6..8ab8b954fd 100644 --- a/uv.lock +++ b/uv.lock @@ -1334,7 +1334,7 @@ requires-dist = [ { name = "alabaster", specifier = ">=0.7.14" }, { name = "babel", specifier = ">=2.13" }, { name = "colorama", marker = "sys_platform == 'win32'", specifier = ">=0.4.6" }, - { name = "docutils", specifier = ">=0.20,<0.23" }, + { name = "docutils", specifier = ">=0.21,<0.23" }, { name = "imagesize", specifier = ">=1.3" }, { name = "jinja2", specifier = ">=3.1" }, { name = "packaging", specifier = ">=23.0" },