8000 Backport PR #26431: MNT: Unpin pyparsing, xfail error message tests f… · matplotlib/matplotlib@c518378 · GitHub
[go: up one dir, main page]

Skip to content

Commit c518378

Browse files
jklymakmeeseeksmachine
authored andcommitted
Backport PR #26431: MNT: Unpin pyparsing, xfail error message tests for pyparsing 3.1.0
1 parent 2e6570a commit c518378

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- pillow>=6.2
2020
- pybind11>=2.6.0
2121
- pygobject
22-
- pyparsing!=3.1.0
22+
- pyparsing>=2.3.1
2323
- pyqt
2424
- python-dateutil>=2.1
2525
- setuptools

lib/matplotlib/tests/test_mathtext.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
from xml.etree import ElementTree as ET
77

88
import numpy as np
9+
from packaging.version import parse as parse_version
10+
import pyparsing
911
import pytest
1012

13+
1114
import matplotlib as mpl
1215
from matplotlib.testing.decorators import check_figures_equal, image_comparison
1316
import matplotlib.pyplot as plt
1417
from matplotlib import mathtext, _mathtext
1518

19+
pyparsing_version = parse_version(pyparsing.__version__)
20+
1621

1722
# If test is removed, use None as placeholder
1823
math_tests = [
@@ -270,6 +275,9 @@ def test_fontinfo():
270275
assert table['version'] == (1, 0)
271276

272277

278+
# See gh-26152 for more context on this xfail
279+
@pytest.mark.xfail(pyparsing_version.release == (3, 1, 0),
280+
reason="Error messages are incorrect for this version")
273281
@pytest.mark.parametrize(
274282
'math, msg',
275283
[

lib/matplotlib/tests/test_text.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import numpy as np
66
from numpy.testing import assert_almost_equal
7+
from packaging.version import parse as parse_version
8+
import pyparsing
79
import pytest
810

911
import matplotlib as mpl
@@ -16,6 +18,8 @@
1618
from matplotlib.testing._markers import needs_usetex
1719
from matplotlib.text import Text
1820

21+
pyparsing_version = parse_version(pyparsing.__version__)
22+
1923

2024
@image_comparison(['font_styles'])
2125
def test_font_styles():
@@ -809,6 +813,9 @@ def test_unsupported_script(recwarn):
809813
(r"Matplotlib currently does not support Bengali natively.",)])
810814

811815

816+
# See gh-26152 for more information on this xfail
817+
@pytest.mark.xfail(pyparsing_version.release == (3, 1, 0),
818+
reason="Error messages are incorrect with pyparsing 3.1.0")
812819
def test_parse_math():
813820
fig, ax = plt.subplots()
814821
ax.text(0, 0, r"$ \wrong{math} $", parse_math=False)
@@ -819,6 +826,9 @@ def test_parse_math():
819826
fig.canvas.draw()
820827

821828

829+
# See gh-26152 for more information on this xfail
830+
@pytest.mark.xfail(pyparsing_version.release == (3, 1, 0),
831+
reason="Error messages are incorrect with pyparsing 3.1.0")
822832
def test_parse_math_rcparams():
823833
# Default is True
824834
fig, ax = plt.subplots()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def make_release_tree(self, base_dir, files):
325325
"numpy>=1.20",
326326
"packaging>=20.0",
327327
"pillow>=6.2.0",
328-
"pyparsing>=2.3.1,<3.1",
328+
"pyparsing>=2.3.1",
329329
"python-dateutil>=2.7",
330330
] + (
331331
# Installing from a git checkout that is not producing a wheel.

0 commit comments

Comments
 (0)
0