Skip to content

Commit cca8506

Browse files
authored
Merge pull request #3514 from Zac-HD/update-lark
Use and test on new versions of Lark
2 parents a38276a + 3eab15e commit cca8506

File tree

10 files changed

+39
-39
lines changed

10 files changed

+39
-39
lines changed

hypothesis-python/RELEASE.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RELEASE_TYPE: patch
2+
3+
This patch shifts ``hypothesis[lark]`` from depending on the old :pypi:`lark-parser`
4+
package to the new :pypi:`lark` package. There are no code changes in Hypothesis,
5+
it's just that Lark got a new name on PyPI for version 1.0 onwards.

hypothesis-python/scripts/basic-test.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ if [ "$(python -c 'import sys; print(sys.version_info[:2] == (3, 7))')" = "False
3939
fi
4040

4141
pip install ".[lark]"
42+
pip install "$(grep -oE 'lark>=([0-9.]+)' ../hypothesis-python/setup.py | tr '>' =)"
43+
$PYTEST -Wignore tests/lark/
44+
pip install "$(grep 'lark==' ../requirements/coverage.txt)"
4245
$PYTEST tests/lark/
43-
pip install "$(grep 'lark-parser==' ../requirements/coverage.txt)"
44-
$PYTEST tests/lark/
45-
pip uninstall -y lark-parser
46+
pip uninstall -y lark
4647

4748
if [ "$(python -c $'import platform, sys; print(sys.version_info.releaselevel == \'final\' and platform.python_implementation() != "PyPy")')" = "True" ] ; then
4849
pip install ".[codemods,cli]"

hypothesis-python/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def local_file(name):
5757
"ghostwriter": ["black>=19.10b0"],
5858
"pytz": ["pytz>=2014.1"],
5959
"dateutil": ["python-dateutil>=1.4"],
60-
"lark": ["lark-parser>=0.6.5"],
60+
"lark": ["lark>=0.10.1"], # probably still works with old `lark-parser` too
6161
"numpy": ["numpy>=1.9.0"],
6262
"pandas": ["pandas>=1.0"],
6363
"pytest": ["pytest>=4.6"],

hypothesis-python/src/hypothesis/extra/lark.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,14 @@
2222
<https://lark-parser.readthedocs.io/en/latest/nearley.html>`_
2323
from `nearley.js <https://nearley.js.org/>`_, so you may not have to write
2424
your own at all.
25-
26-
Note that as Lark is at version 0.x, this module *may* break API compatibility
27-
in minor releases if supporting the latest version of Lark would otherwise be
28-
infeasible. We may also be quite aggressive in bumping the minimum version of
29-
Lark, unless someone volunteers to either fund or do the maintenance.
3025
"""
3126

3227
from inspect import signature
3328
from typing import Dict, Optional
3429

3530
import attr
3631
import lark
37-
from lark.grammar import NonTerminal, Terminal # type: ignore
32+
from lark.grammar import NonTerminal, Terminal
3833

3934
from hypothesis import strategies as st
4035
from hypothesis.errors import InvalidArgument

hypothesis-python/tests/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Still here? Here's a note on what to expect in each directory.
8989

9090
``lark/``
9191
Tests for the Lark extra for context-free grammars, which depend on the
92-
``lark-parser`` package.
92+
``lark`` package.
9393

9494
``nocover/``
9595
More expensive and longer-running tests, typically used to test trickier

pytest.ini

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
[pytest]
22

33
# -rfEX :: Print a summary of failures, errors, and xpasses (xfails that pass).
4-
addopts=--strict-markers --tb=native -p pytester --runpytest=subprocess --durations=20 -rfEX
4+
addopts =
5+
-rfEX
6+
--strict-markers
7+
--tb=native
8+
-p pytester
9+
--runpytest=subprocess
10+
--durations=20
511
xfail_strict = True
612
filterwarnings =
713
error
@@ -11,9 +17,6 @@ filterwarnings =
1117
default:distutils Version classes are deprecated\. Use packaging\.version instead:DeprecationWarning
1218
# https://github.com/pandas-dev/pandas/issues/32056 (?)
1319
default:numpy\.ufunc size changed, may indicate binary incompatibility\. Expected 216 from C header, got 232 from PyObject:RuntimeWarning
14-
# https://github.com/lark-parser/lark/pull/1140
15-
default:module 'sre_constants' is deprecated:DeprecationWarning
16-
default:module 'sre_parse' is deprecated:DeprecationWarning
1720
# https://github.com/pandas-dev/pandas/issues/34848
1821
default:`np\.bool` is a deprecated alias for the builtin `bool`:DeprecationWarning
1922
default:`np\.complex` is a deprecated alias for the builtin `complex`:DeprecationWarning

requirements/coverage.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ click
44
coverage
55
dpcontracts
66
fakeredis
7-
lark-parser
7+
lark
88
libcst
99
numpy
1010
pandas

requirements/coverage.txt

+4-8
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ click==8.1.3
2020
# black
2121
coverage==6.5.0
2222
# via -r requirements/coverage.in
23-
deprecated==1.2.13
24-
# via redis
2523
dpcontracts==0.6.0
2624
# via -r requirements/coverage.in
2725
exceptiongroup==1.0.4 ; python_version < "3.11"
@@ -34,23 +32,23 @@ fakeredis==2.0.0
3432
# via -r requirements/coverage.in
3533
iniconfig==1.1.1
3634
# via pytest
37-
lark-parser==0.12.0
35+
lark==1.1.4
3836
# via -r requirements/coverage.in
3937
libcst==0.4.9
4038
# via -r requirements/coverage.in
4139
mypy-extensions==0.4.3
4240
# via
4341
# black
4442
# typing-inspect
45-
numpy==1.23.4
43+
numpy==1.23.5
4644
# via
4745
# -r requirements/coverage.in
4846
# pandas
4947
packaging==21.3
5048
# via
5149
# pytest
5250
# redis
53-
pandas==1.5.1
51+
pandas==1.5.2
5452
# via -r requirements/coverage.in
5553
pathspec==0.10.2
5654
# via black
@@ -80,7 +78,7 @@ pytz==2022.6
8078
# pandas
8179
pyyaml==6.0
8280
# via libcst
83-
redis==4.3.4
81+
redis==4.3.5
8482
# via fakeredis
8583
six==1.16.0
8684
# via python-dateutil
@@ -100,5 +98,3 @@ typing-extensions==4.4.0
10098
# typing-inspect
10199
typing-inspect==0.8.0
102100
# via libcst
103-
wrapt==1.14.1
104-
# via deprecated

requirements/tools.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ flake8-return
1818
flake8-simplify
1919
# flake8-strftime # See https://github.com/python-formate/flake8_strftime/issues/47
2020
ipython
21-
lark-parser
21+
lark
2222
libcst
2323
mypy
2424
pip-tools

requirements/tools.txt

+14-14
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ attrs==22.1.0
1717
# flake8-bugbear
1818
# hypothesis (hypothesis-python/setup.py)
1919
# pytest
20-
autoflake==1.7.7
20+
autoflake==2.0.0
2121
# via shed
2222
babel==2.11.0
2323
# via sphinx
@@ -79,7 +79,7 @@ filelock==3.8.0
7979
# via
8080
# tox
8181
# virtualenv
82-
flake8==5.0.4
82+
flake8==6.0.0
8383
# via
8484
# -r requirements/tools.in
8585
# flake8-2020
@@ -108,7 +108,7 @@ flake8-docstrings==1.6.0
108108
# via -r requirements/tools.in
109109
flake8-mutable==1.2.0
110110
# via -r requirements/tools.in
111-
flake8-noqa==1.2.9
111+
flake8-noqa==1.3.0
112112
# via -r requirements/tools.in
113113
flake8-pie==0.16.0
114114
# via -r requirements/tools.in
@@ -122,15 +122,15 @@ flake8-return==1.2.0
122122
# via -r requirements/tools.in
123123
flake8-simplify==0.19.3
124124
# via -r requirements/tools.in
125-
gitdb==4.0.9
125+
gitdb==4.0.10
126126
# via gitpython
127127
gitpython==3.1.29
128128
# via bandit
129129
idna==3.4
130130
# via requests
131131
imagesize==1.4.1
132132
# via sphinx
133-
importlib-metadata==5.0.0
133+
importlib-metadata==5.1.0
134134
# via
135135
# keyring
136136
# sphinx
@@ -143,7 +143,7 @@ isort==5.10.1
143143
# via shed
144144
jaraco-classes==3.2.3
145145
# via keyring
146-
jedi==0.18.1
146+
jedi==0.18.2
147147
# via ipython
148148
jeepney==0.8.0
149149
# via
@@ -153,7 +153,7 @@ jinja2==3.1.2
153153
# via sphinx
154154
keyring==23.11.0
155155
# via twine
156-
lark-parser==0.12.0
156+
lark==1.1.4
157157
# via -r requirements/tools.in
158158
libcst==0.4.9
159159
# via
@@ -206,21 +206,21 @@ pluggy==1.0.0
206206
# via
207207
# pytest
208208
# tox
209-
prompt-toolkit==3.0.32
209+
prompt-toolkit==3.0.33
210210
# via ipython
211211
ptyprocess==0.7.0
212212
# via pexpect
213213
pure-eval==0.2.2
214214
# via stack-data
215215
py==1.11.0
216216
# via tox
217-
pycodestyle==2.9.1
217+
pycodestyle==2.10.0
218218
# via flake8
219219
pycparser==2.21
220220
# via cffi
221221
pydocstyle==6.1.1
222222
# via flake8-docstrings
223-
pyflakes==2.5.0
223+
pyflakes==3.0.1
224224
# via
225225
# autoflake
226226
# flake8
@@ -232,7 +232,7 @@ pygments==2.13.0
232232
# sphinx
233233
pyparsing==3.0.9
234234
# via packaging
235-
pyright==1.1.280
235+
pyright==1.1.281
236236
# via -r requirements/tools.in
237237
pytest==7.2.0
238238
# via -r requirements/tools.in
@@ -341,7 +341,7 @@ types-pkg-resources==0.1.3
341341
# via -r requirements/tools.in
342342
types-pytz==2022.6.0.1
343343
# via -r requirements/tools.in
344-
types-redis==4.3.21.4
344+
types-redis==4.3.21.5
345345
# via -r requirements/tools.in
346346
typing-extensions==4.4.0
347347
# via
@@ -355,7 +355,7 @@ typing-extensions==4.4.0
355355
# typing-inspect
356356
typing-inspect==0.8.0
357357
# via libcst
358-
urllib3==1.26.12
358+
urllib3==1.26.13
359359
# via
360360
# requests
361361
# twine
@@ -367,7 +367,7 @@ webencodings==0.5.1
367367
# via bleach
368368
wheel==0.38.4
369369
# via pip-tools
370-
zipp==3.10.0
370+
zipp==3.11.0
371371
# via importlib-metadata
372372

373373
# The following packages are considered to be unsafe in a requirements file:

0 commit comments

Comments
 (0)