Repository: pypa/readme_renderer (language: python)

Issue:
docutils 0.21.2 breaks the test suite
docutils 0.20.1, installed in the Python 3.8 tox environment, matches test suite expectations.

docutils 0.21.2, installed in Python 3.9+ tox environments, breaks the test suite.

There appear to be small changes, like additional newlines, but also substantial differences, like this partial diff between what the test suite expected and what docutils 0.21.2 emitted:

```diff
- <nav class="contents" id="contents">\n<p class="topic-title">Contents</p>
+ <nav class="contents" id="contents">\n<p class="topic-title"><a href="#top" rel="nofollow">Contents</a></p>
```

As this isn't simply a whitespace change, I'm not currently pursuing a solution to this.
docutils 0.21.2 breaks the test suite
docutils 0.20.1, installed in the Python 3.8 tox environment, matches test suite expectations.

docutils 0.21.2, installed in Python 3.9+ tox environments, breaks the test suite.

There appear to be small changes, like additional newlines, but also substantial differences, like this partial diff between what the test suite expected and what docutils 0.21.2 emitted:

```diff
- <nav class="contents" id="contents">\n<p class="topic-title">Contents</p>
+ <nav class="contents" id="contents">\n<p class="topic-title"><a href="#top" rel="nofollow">Contents</a></p>
```

As this isn't simply a whitespace change, I'm not currently pursuing a solution to this.


Discussion / hints:
Thanks for figuring that out.

While pinning to the older version will help pass the test suite, if we don't pin an upper bound to the package's dependency we'll get a different result from rendering the output (which might already be happening to folks today).

I think I'm more amenable to pushing forward with using the latest (and bumping the minimum version in `pyproject.toml`) and adapting the tests.

Python 3.8 EOL is in 4 months, I don't feel strongly that we need to preserve support for this library going forward.
@miketheman Thanks for the feedback. To confirm, #311 could be closed in favor of a PR that:

* Drops support for Python 3.8
* Pins docutils to 0.21.x
* Updates the fixture files that render differently under the new docutils version

Does that match what you would expect from a PR that could close this issue?
Yes, that seems to be a good list of items.
When dropping 3.8 support, please also update the classifier list.
Thanks for figuring that out.

While pinning to the older version will help pass the test suite, if we don't pin an upper bound to the package's dependency we'll get a different result from rendering the output (which might already be happening to folks today).

I think I'm more amenable to pushing forward with using the latest (and bumping the minimum version in `pyproject.toml`) and adapting the tests.

Python 3.8 EOL is in 4 months, I don't feel strongly that we need to preserve support for this library going forward.
@miketheman Thanks for the feedback. To confirm, #311 could be closed in favor of a PR that:

* Drops support for Python 3.8
* Pins docutils to 0.21.x
* Updates the fixture files that render differently under the new docutils version

Does that match what you would expect from a PR that could close this issue?
Yes, that seems to be a good list of items.
When dropping 3.8 support, please also update the classifier list.

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2be7298..06b7261 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,7 +6,13 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ["pypy-3.8", "3.8", "3.9", "3.10", "3.11", "3.12"]
+        python-version:
+          - "pypy-3.9"
+          - "pypy-3.10"
+          - "3.9"
+          - "3.10"
+          - "3.11"
+          - "3.12"
     steps:
       - name: Check out repository
         uses: actions/checkout@v3
diff --git a/pyproject.toml b/pyproject.toml
index dcae475..6e1278b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,7 +7,11 @@ authors = [
 ]
 readme = "README.rst"
 license = {text = "Apache License, Version 2.0"}
-dependencies = ["nh3>=0.2.14", "docutils>=0.13.1", "Pygments>=2.5.1"]
+dependencies = [
+  "nh3>=0.2.14",
+  "docutils>=0.21.2",
+  "Pygments>=2.5.1",
+]
 classifiers = [
   "Intended Audience :: Developers",
   "License :: OSI Approved :: Apache Software License",
@@ -20,7 +24,6 @@ classifiers = [
   "Programming Language :: Python",
   "Programming Language :: Python :: 3",
   "Programming Language :: Python :: 3 :: Only",
-  "Programming Language :: Python :: 3.8",
   "Programming Language :: Python :: 3.9",
   "Programming Language :: Python :: 3.10",
   "Programming Language :: Python :: 3.11",
@@ -29,7 +32,7 @@ classifiers = [
   "Programming Language :: Python :: Implementation :: PyPy",
   "Typing :: Typed"
 ]
-requires-python = ">=3.8"
+requires-python = ">=3.9"
 
 [project.optional-dependencies]
 md = ["cmarkgfm>=0.8.0"]
diff --git a/readme_renderer/clean.py b/readme_renderer/clean.py
index 6cd5972..a123044 100644
--- a/readme_renderer/clean.py
+++ b/readme_renderer/clean.py
@@ -26,7 +26,7 @@
     "br", "caption", "cite", "col", "colgroup", "dd", "del", "details", "div",
     "dl", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "img", "p", "pre",
     "span", "sub", "summary", "sup", "table", "tbody", "td", "th", "thead",
-    "tr", "tt", "kbd", "var", "input", "section", "aside", "nav", "s", "figure",
+    "tr", "tt", "kbd", "var", "input", "section", "aside", "nav", "figure",
     "figcaption", "picture",
 }
 
diff --git a/tox.ini b/tox.ini
index 4a92134..2c4e763 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,11 @@
 [tox]
-envlist = py38,py39,py310,py311,py312,pep8,packaging,noextra,mypy
+envlist =
+    py{39, 310, 311, 312}
+    pypy{39, 310}
+    pep8
+    packaging
+    noextra
+    mypy
 isolated_build = True
 
 [testenv]


Test patch:
diff --git a/tests/fixtures/test_rst_bibtex.html b/tests/fixtures/test_rst_bibtex.html
index d9048e7..0f312a7 100644
--- a/tests/fixtures/test_rst_bibtex.html
+++ b/tests/fixtures/test_rst_bibtex.html
@@ -1,2 +1,2 @@
 <pre><code><span class="nc">@article</span><span class="p">{</span><span class="nl">the_impact_of_pygments_docutils_config_and_html5</span><span class="p">,</span><span class="w">
-  </span><span class="na">year</span><span class="w"> </span><span class="p">=</span><span class="w"> </span>
{2022}
<span class="p">,</span></code></pre>
+  </span><span class="na">year</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">{2022}</span><span class="p">,</span></code></pre>
diff --git a/tests/fixtures/test_rst_contents.html b/tests/fixtures/test_rst_contents.html
index 48a5556..445f610 100644
--- a/tests/fixtures/test_rst_contents.html
+++ b/tests/fixtures/test_rst_contents.html
@@ -1,5 +1,5 @@
 <nav class="contents" id="contents">
-<p class="topic-title">Contents</p>
+<p class="topic-title"><a href="#top" rel="nofollow">Contents</a></p>
 <ul class="simple">
 <li><p><a href="#features" id="toc-entry-1" rel="nofollow">Features</a></p></li>
 <li><p><a href="#installation" id="toc-entry-2" rel="nofollow">Installation</a></p></li>
diff --git a/tests/fixtures/test_rst_linkify.html b/tests/fixtures/test_rst_linkify.html
index 5956925..f796a70 100644
--- a/tests/fixtures/test_rst_linkify.html
+++ b/tests/fixtures/test_rst_linkify.html
@@ -1,5 +1,9 @@
-<a href="https://travis-ci.org/tulsawebdevs/django-multi-gtfs" rel="nofollow"><img alt="https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?branch=master" src="https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?branch=master"></a>
-<a href="https://coveralls.io/github/tulsawebdevs/django-multi-gtfs" rel="nofollow"><img alt="https://coveralls.io/repos/github/tulsawebdevs/django-multi-gtfs/badge.svg?branch=django19" src="https://coveralls.io/repos/github/tulsawebdevs/django-multi-gtfs/badge.svg?branch=django19"></a>
+<a href="https://travis-ci.org/tulsawebdevs/django-multi-gtfs" rel="nofollow">
+<img alt="https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?branch=master" src="https://travis-ci.org/tulsawebdevs/django-multi-gtfs.svg?branch=master">
+</a>
+<a href="https://coveralls.io/github/tulsawebdevs/django-multi-gtfs" rel="nofollow">
+<img alt="https://coveralls.io/repos/github/tulsawebdevs/django-multi-gtfs/badge.svg?branch=django19" src="https://coveralls.io/repos/github/tulsawebdevs/django-multi-gtfs/badge.svg?branch=django19">
+</a>
 <p><strong>multigtfs</strong> is an <a href="http://choosealicense.com/licenses/apache/" rel="nofollow">Apache 2.0</a>-licensed Django app that supports importing
 and exporting of GTFS feeds.  All features of the <a href="https://developers.google.com/transit/gtfs/reference" rel="nofollow">June 20, 2012 reference</a>
 are supported, including <a href="https://developers.google.com/transit/gtfs/changes#RevisionHistory" rel="nofollow">all changes</a> up to February 17, 2014.