Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MNT: Unpin pyparsing, xfail error message tests for pyparsing 3.1.0 #26431

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

Merged
merged 1 commit into from
Aug 1, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- pillow>=6.2
- pybind11>=2.6.0
- pygobject
- pyparsing!=3.1.0
- pyparsing>=2.3.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not need to exclude the version that doesn't work?

- pyqt
- python-dateutil>=2.1
- setuptools
Expand Down
8 changes: 8 additions & 0 deletions lib/matplotlib/tests/test_mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
from typing import Any

import numpy as np
from packaging.version import parse as parse_version
import pyparsing
import pytest


import matplotlib as mpl
from matplotlib.testing.decorators import check_figures_equal, image_comparison
import matplotlib.pyplot as plt
from matplotlib import mathtext, _mathtext

pyparsing_version = parse_version(pyparsing.__version__)


# If test is removed, use None as placeholder
math_tests = [
Expand Down Expand Up @@ -279,6 +284,9 @@ def test_fontinfo():
assert table['version'] == (1, 0)


# See gh-26152 for more context on this xfail
@pytest.mark.xfail(pyparsing_version.release == (3, 1, 0),
reason="Error messages are incorrect for this version")
@pytest.mark.parametrize(
'math, msg',
[
Expand Down
10 changes: 10 additions & 0 deletions lib/matplotlib/tests/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import numpy as np
from numpy.testing import assert_almost_equal
from packaging.version import parse as parse_version
import pyparsing
import pytest

import matplotlib as mpl
Expand All @@ -16,6 +18,8 @@
from matplotlib.testing._markers import needs_usetex
from matplotlib.text import Text, Annotation

pyparsing_version = parse_version(pyparsing.__version__)


@image_comparison(['font_styles'])
def test_font_styles():
Expand Down Expand Up @@ -818,6 +822,9 @@ def test_unsupported_script(recwarn):
(r"Matplotlib currently does not support Bengali natively.",)])


# See gh-26152 for more information on this xfail
@pytest.mark.xfail(pyparsing_version.release == (3, 1, 0),
reason="Error messages are incorrect with pyparsing 3.1.0")
def test_parse_math():
fig, ax = plt.subplots()
ax.text(0, 0, r"$ \wrong{math} $", parse_math=False)
Expand All @@ -828,6 +835,9 @@ def test_parse_math():
fig.canvas.draw()


# See gh-26152 for more information on this xfail
@pytest.mark.xfail(pyparsing_version.release == (3, 1, 0),
reason="Error messages are incorrect with pyparsing 3.1.0")
def test_parse_math_rcparams():
# Default is True
fig, ax = plt.subplots()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def make_release_tree(self, base_dir, files):
"numpy>=1.21",
"packaging>=20.0",
"pillow>=6.2.0",
"pyparsing>=2.3.1,<3.1",
"pyparsing>=2.3.1",
"python-dateutil>=2.7",
] + (
# Installing from a git checkout that is not producing a wheel.
Expand Down