We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0853185 commit 720ac9aCopy full SHA for 720ac9a
lib/matplotlib/_mathtext.py
@@ -2128,9 +2128,9 @@ def __init__(self):
2128
p.subsuper <<= (
2129
(Optional(p.placeable)("nucleus")
2130
+ OneOrMore(oneOf(["_", "^"]) - p.placeable)("subsuper")
2131
- + ZeroOrMore("'")("apostrophes"))
2132
- | OneOrMore("'")("apostrophes")
2133
- | (p.placeable("nucleus") + ZeroOrMore("'")("apostrophes"))
+ + Regex("'*")("apostrophes"))
+ | Regex("'+")("apostrophes")
+ | (p.placeable("nucleus") + Regex("'*")("apostrophes"))
2134
)
2135
2136
p.token <<= (
lib/matplotlib/tests/test_mathtext.py
@@ -250,7 +250,9 @@ def test_fontinfo():
250
(r'$\leftF$', r'Expected a delimiter'),
251
(r'$\rightF$', r'Unknown symbol: \rightF'),
252
(r'$\left(\right$', r'Expected a delimiter'),
253
- (r'$\left($', r'Expected "\right"'),
+ # PyParsing 2 uses double quotes, PyParsing 3 uses single quotes and an
254
+ # extra backslash.
255
+ (r'$\left($', re.compile(r'Expected ("|\'\\)\\right["\']')),
256
(r'$\dfrac$', r'Expected \dfrac{num}{den}'),
257
(r'$\dfrac{}{}$', r'Expected \dfrac{num}{den}'),
258
(r'$\overset$', r'Expected \overset{annotation}{body}'),
@@ -281,8 +283,8 @@ def test_fontinfo():
281
283
282
284
def test_mathtext_exceptions(math, msg):
285
parser = mathtext.MathTextParser('agg')
-
- with pytest.raises(ValueError, match=re.escape(msg)):
286
+ match = re.escape(msg) if isinstance(msg, str) else msg
287
+ with pytest.raises(ValueError, match=match):
288
parser.parse(math)
289
290
requirements/doc/doc-requirements.txt
@@ -13,7 +13,6 @@ ipython
13
ipywidgets
14
numpydoc>=0.8
15
packaging>=20
16
-pyparsing<3.0.0
17
mpl-sphinx-theme
18
sphinxcontrib-svg2pdfconverter>=1.1.0
19
sphinx-gallery>=0.10
requirements/testing/all.txt
@@ -2,7 +2,6 @@
2
3
certifi
4
coverage
5
6
pytest!=4.6.0,!=5.4.0
7
pytest-cov
8
pytest-rerunfailures
setup.py
@@ -319,7 +319,7 @@ def make_release_tree(self, base_dir, files):
319
"numpy>=1.17",
320
"packaging>=20.0",
321
"pillow>=6.2.0",
322
- "pyparsing>=2.2.1,<3.0.0",
+ "pyparsing>=2.2.1",
323
"python-dateutil>=2.7",
324
] + (
325
# Installing from a git checkout.
0 commit comments