Skip to content

Commit

Permalink
Require Pygments 2.14 or later (#11576)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Aug 10, 2023
1 parent 8cabf08 commit 976dd07
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -5,6 +5,7 @@ Dependencies
------------

* #11511: Drop Python 3.8 support.
* #11576: Require Pygments 2.14 or later.

Incompatible changes
--------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -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",
Expand Down
6 changes: 1 addition & 5 deletions tests/test_ext_viewcode.py
Expand Up @@ -3,7 +3,6 @@
import re
import shutil

import pygments
import pytest


Expand Down Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions tests/test_intl.py
Expand Up @@ -10,7 +10,6 @@
import time
from pathlib import Path

import pygments
import pytest
from babel.messages import mofile, pofile
from babel.messages.catalog import Catalog
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 976dd07

Please sign in to comment.