From 811da79b613f4727c815bca37fbddbc54370d7c1 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 15 Aug 2022 19:00:23 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20UPGRADE:=20docutils=20?= =?UTF-8?q?0.19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 2 +- pyproject.toml | 2 +- .../test_renderers/fixtures/docutil_roles.md | 4 +- .../test_renderers/test_fixtures_docutils.py | 13 +- tests/test_sphinx/test_sphinx_builds.py | 4 + .../test_footnotes.sphinx5.html | 204 +++++++++--------- 6 files changed, 123 insertions(+), 106 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4000d5da..c05356e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,7 +70,7 @@ jobs: strategy: fail-fast: false matrix: - docutils-version: ["0.16", "0.17", "0.18"] + docutils-version: ["0.17", "0.18", "0.19"] steps: - name: Checkout source diff --git a/pyproject.toml b/pyproject.toml index a2e988ab..d375a604 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ keywords = [ ] requires-python = ">=3.7" dependencies = [ - "docutils>=0.15,<0.19", + "docutils>=0.15,<0.20", "jinja2", # required for substitutions, but let sphinx choose version "markdown-it-py>=1.0.0,<3.0.0", "mdit-py-plugins~=0.3.0", diff --git a/tests/test_renderers/fixtures/docutil_roles.md b/tests/test_renderers/fixtures/docutil_roles.md index 1aabac99..51fa48d1 100644 --- a/tests/test_renderers/fixtures/docutil_roles.md +++ b/tests/test_renderers/fixtures/docutil_roles.md @@ -93,7 +93,7 @@ . - + PEP 0 . @@ -104,7 +104,7 @@ . - + RFC 1 . diff --git a/tests/test_renderers/test_fixtures_docutils.py b/tests/test_renderers/test_fixtures_docutils.py index d80792f3..a1e16e52 100644 --- a/tests/test_renderers/test_fixtures_docutils.py +++ b/tests/test_renderers/test_fixtures_docutils.py @@ -50,7 +50,18 @@ def _apply_transforms(self): parser=Parser(), ) - file_params.assert_expected(doctree.pformat(), rstrip_lines=True) + ptree = doctree.pformat() + # docutils >=0.19 changes: + ptree = ptree.replace( + 'refuri="http://tools.ietf.org/html/rfc1.html"', + 'refuri="https://tools.ietf.org/html/rfc1.html"', + ) + ptree = ptree.replace( + 'refuri="http://www.python.org/dev/peps/pep-0000"', + 'refuri="https://peps.python.org/pep-0000"', + ) + + file_params.assert_expected(ptree, rstrip_lines=True) @pytest.mark.param_file(FIXTURE_PATH / "docutil_directives.md") diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index c30850f8..beba4845 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -299,6 +299,10 @@ def test_include_from_rst( ) +@pytest.mark.skipif( + __version_info__ < VersionInfo(0, 19, 0, "final", 0, True), + reason="Footnote HTML changed in docutils 0.19", +) @pytest.mark.sphinx( buildername="html", srcdir=os.path.join(SOURCE_DIR, "footnotes"), freshenv=True ) diff --git a/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx5.html b/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx5.html index 9129e236..546739c3 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx5.html +++ b/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx5.html @@ -97,113 +97,115 @@


- - - -