Require Pygments 2.14 or later (#11576)

This commit is contained in:
Adam Turner 2023-08-10 12:35:45 +01:00 committed by GitHub
parent 8cabf08668
commit 976dd07ffe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 11 deletions

View File

@ -5,6 +5,7 @@ Dependencies
------------
* #11511: Drop Python 3.8 support.
* #11576: Require Pygments 2.14 or later.
Incompatible changes
--------------------

View File

@ -61,7 +61,7 @@ dependencies = [
"sphinxcontrib-serializinghtml>=1.1.5",
"sphinxcontrib-qthelp",
"Jinja2>=3.0",
"Pygments>=2.13",
"Pygments>=2.14",
"docutils>=0.18.1,<0.21",
"snowballstemmer>=2.0",
"babel>=2.9",

View File

@ -3,7 +3,6 @@
import re
import shutil
import pygments
import pytest
@ -34,10 +33,7 @@ def check_viewcode_output(app, warning):
'<a class="viewcode-back" href="../../index.html#spam.Class1">[docs]</a>\n') in result
assert '<span>@decorator</span>\n' in result
assert '<span>class</span> <span>Class1</span><span>:</span>\n' in result
if pygments.__version__ >= '2.14.0':
assert '<span> </span><span>&quot;&quot;&quot;</span>\n' in result
else:
assert ' <span>&quot;&quot;&quot;</span>\n' in result
assert '<span> </span><span>&quot;&quot;&quot;</span>\n' in result
assert '<span> this is Class1</span>\n' in result
assert '<span> &quot;&quot;&quot;</span>\n' in result

View File

@ -10,7 +10,6 @@ import shutil
import time
from pathlib import Path
import pygments
import pytest
from babel.messages import mofile, pofile
from babel.messages.catalog import Catalog
@ -1170,8 +1169,6 @@ def test_additional_targets_should_not_be_translated(app):
"""<span class="k">in</span>"""
"""<span class="w"> </span>"""
"""<span class="n">list</span>""")
if pygments.__version__ < '2.14.0':
expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted
@ -1248,8 +1245,6 @@ def test_additional_targets_should_be_translated(app):
"""<span class="no">IN</span>"""
"""<span class="w"> </span>"""
"""<span class="no">LIST</span>""")
if pygments.__version__ < '2.14.0':
expected_expr = expected_expr.replace("""<span class="w"> </span>""", ' ')
assert_count(expected_expr, result, 1)
# doctest block should not be translated but be highlighted