Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Pygments 2.14 or later #11576

Merged
merged 3 commits into from Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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