Skip to content

Commit acbaf9e

Browse files
authored
Merge pull request #3022 from HypothesisWorks/create-pull-request/patch
2 parents 5181a22 + 2567162 commit acbaf9e

File tree

9 files changed

+61
-48
lines changed

9 files changed

+61
-48
lines changed

hypothesis-python/RELEASE.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
RELEASE_TYPE: patch
2+
3+
This patch updates some internal type annotations.
4+
There is no user-visible change.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class HypothesisFixComplexMinMagnitude(VisitorBasedCodemodCommand):
103103
METADATA_DEPENDENCIES = (cst.metadata.QualifiedNameProvider,)
104104

105105
@m.call_if_inside(
106-
m.Call(metadata=match_qualname("hypothesis.strategies.complex_numbers"))
106+
m.Call(metadata=match_qualname("hypothesis.strategies.complex_numbers")) # type: ignore
107107
)
108108
def leave_Arg(self, original_node, updated_node):
109109
if m.matches(

hypothesis-python/src/hypothesis/strategies/_internal/core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def lists(
265265
and len(unique_by) == 1
266266
and (
267267
# Introspection for either `itemgetter(0)`, or `lambda x: x[0]`
268-
isinstance(unique_by[0], operator.itemgetter) # type: ignore
268+
isinstance(unique_by[0], operator.itemgetter)
269269
and repr(unique_by[0]) == "operator.itemgetter(0)"
270270
or isinstance(unique_by[0], FunctionType)
271271
and re.fullmatch(
@@ -858,9 +858,6 @@ def builds(
858858
)
859859
for kw in set(hints) & (required | to_infer):
860860
kwargs[kw] = from_type(hints[kw])
861-
862-
# Mypy doesn't realise that `infer` is gone from kwargs now
863-
# and thinks that target and args have the same (union) type.
864861
return BuildsStrategy(target, args, kwargs)
865862

866863

hypothesis-python/src/hypothesis/strategies/_internal/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ def _networks(bits):
405405
UnicodeTranslateError, st.text(), st.just(0), st.just(0), st.just("reason")
406406
),
407407
enumerate: st.builds(enumerate, st.just(())),
408-
filter: st.builds(filter, st.just(lambda _: None), st.just(())), # type: ignore
409-
map: st.builds(map, st.just(lambda _: None), st.just(())), # type: ignore
410-
reversed: st.builds(reversed, st.just(())), # type: ignore
408+
filter: st.builds(filter, st.just(lambda _: None), st.just(())),
409+
map: st.builds(map, st.just(lambda _: None), st.just(())),
410+
reversed: st.builds(reversed, st.just(())),
411411
classmethod: st.builds(classmethod, st.just(lambda self: self)),
412412
staticmethod: st.builds(staticmethod, st.just(lambda self: self)),
413413
super: st.builds(super, st.from_type(type)),

requirements/coverage.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile
2+
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
55
# pip-compile --output-file=requirements/coverage.txt hypothesis-python/setup.py requirements/coverage.in
@@ -10,11 +10,11 @@ coverage==5.5
1010
# via -r requirements/coverage.in
1111
lark-parser==0.11.3
1212
# via -r requirements/coverage.in
13-
numpy==1.20.3
13+
numpy==1.21.0
1414
# via
1515
# -r requirements/coverage.in
1616
# pandas
17-
pandas==1.2.4
17+
pandas==1.2.5
1818
# via -r requirements/coverage.in
1919
python-dateutil==2.8.1
2020
# via pandas

requirements/test.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#
2-
# This file is autogenerated by pip-compile
2+
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
55
# pip-compile --output-file=requirements/test.txt hypothesis-python/setup.py requirements/test.in
66
#
7-
apipkg==1.5
8-
# via execnet
97
attrs==21.2.0
108
# via
119
# hypothesis (hypothesis-python/setup.py)
1210
# pytest
13-
execnet==1.8.1
11+
execnet==1.9.0
1412
# via pytest-xdist
1513
iniconfig==1.1.1
1614
# via pytest
@@ -28,15 +26,15 @@ py==1.10.0
2826
# pytest-forked
2927
pyparsing==2.4.7
3028
# via packaging
31-
pytest-forked==1.3.0
32-
# via pytest-xdist
33-
pytest-xdist==2.2.1
34-
# via -r requirements/test.in
3529
pytest==6.2.4
3630
# via
3731
# -r requirements/test.in
3832
# pytest-forked
3933
# pytest-xdist
34+
pytest-forked==1.3.0
35+
# via pytest-xdist
36+
pytest-xdist==2.3.0
37+
# via -r requirements/test.in
4038
sortedcontainers==2.4.0
4139
# via hypothesis (hypothesis-python/setup.py)
4240
toml==0.10.2

requirements/tools.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ toml
2828
tox
2929
traitlets < 5.0 # drops support for Python 3.6
3030
twine
31+
types-click
32+
types-pkg_resources
33+
types-pytz
34+
types-redis

requirements/tools.txt

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile
2+
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
55
# pip-compile --output-file=requirements/tools.txt hypothesis-python/setup.py requirements/tools.in
@@ -75,6 +75,16 @@ filelock==3.0.12
7575
# via
7676
# tox
7777
# virtualenv
78+
flake8==3.9.2
79+
# via
80+
# -r requirements/tools.in
81+
# flake8-2020
82+
# flake8-bandit
83+
# flake8-bugbear
84+
# flake8-comprehensions
85+
# flake8-docstrings
86+
# flake8-mutable
87+
# flake8-polyfill
7888
flake8-2020==1.6.0
7989
# via -r requirements/tools.in
8090
flake8-bandit==2.1.2
@@ -89,19 +99,9 @@ flake8-mutable==1.2.0
8999
# via -r requirements/tools.in
90100
flake8-polyfill==1.0.2
91101
# via flake8-bandit
92-
flake8==3.9.2
93-
# via
94-
# -r requirements/tools.in
95-
# flake8-2020
96-
# flake8-bandit
97-
# flake8-bugbear
98-
# flake8-comprehensions
99-
# flake8-docstrings
100-
# flake8-mutable
101-
# flake8-polyfill
102102
gitdb==4.0.7
103103
# via gitpython
104-
gitpython==3.1.17
104+
gitpython==3.1.18
105105
# via bandit
106106
idna==2.10
107107
# via requests
@@ -113,11 +113,11 @@ importlib-metadata==4.5.0
113113
# twine
114114
iniconfig==1.1.1
115115
# via pytest
116-
ipython-genutils==0.2.0
117-
# via traitlets
118116
ipython==7.16.1
119117
# via -r requirements/tools.in
120-
isort==5.8.0
118+
ipython-genutils==0.2.0
119+
# via traitlets
120+
isort==5.9.1
121121
# via shed
122122
jedi==0.18.0
123123
# via ipython
@@ -140,13 +140,13 @@ markupsafe==2.0.1
140140
# via jinja2
141141
mccabe==0.6.1
142142
# via flake8
143+
mypy==0.910
144+
# via -r requirements/tools.in
143145
mypy-extensions==0.4.3
144146
# via
145147
# black
146148
# mypy
147149
# typing-inspect
148-
mypy==0.812
149-
# via -r requirements/tools.in
150150
packaging==20.9
151151
# via
152152
# bleach
@@ -165,15 +165,15 @@ pexpect==4.8.0
165165
# via ipython
166166
pickleshare==0.7.5
167167
# via ipython
168-
pip-tools==6.1.0
168+
pip-tools==6.2.0
169169
# via -r requirements/tools.in
170170
pkginfo==1.7.0
171171
# via twine
172172
pluggy==0.13.1
173173
# via
174174
# pytest
175175
# tox
176-
prompt-toolkit==3.0.18
176+
prompt-toolkit==3.0.19
177177
# via ipython
178178
ptyprocess==0.7.0
179179
# via pexpect
@@ -223,14 +223,14 @@ readme-renderer==29.0
223223
# via twine
224224
regex==2021.4.4
225225
# via black
226-
requests-toolbelt==0.9.1
227-
# via twine
228226
requests==2.25.1
229227
# via
230228
# -r requirements/tools.in
231229
# requests-toolbelt
232230
# sphinx
233231
# twine
232+
requests-toolbelt==0.9.1
233+
# via twine
234234
restructuredtext-lint==1.3.2
235235
# via -r requirements/tools.in
236236
rfc3986==1.5.0
@@ -256,16 +256,16 @@ snowballstemmer==2.1.0
256256
# sphinx
257257
sortedcontainers==2.4.0
258258
# via hypothesis (hypothesis-python/setup.py)
259+
sphinx==4.0.2
260+
# via
261+
# -r requirements/tools.in
262+
# sphinx-rtd-theme
259263
sphinx-hoverxref==0.6b1
260264
# via -r requirements/tools.in
261265
sphinx-rtd-theme==0.5.2
262266
# via -r requirements/tools.in
263267
sphinx-selective-exclude==1.0.3
264268
# via -r requirements/tools.in
265-
sphinx==4.0.2
266-
# via
267-
# -r requirements/tools.in
268-
# sphinx-rtd-theme
269269
sphinxcontrib-applehelp==1.0.2
270270
# via sphinx
271271
sphinxcontrib-devhelp==1.0.2
@@ -288,6 +288,7 @@ toml==0.10.2
288288
# via
289289
# -r requirements/tools.in
290290
# black
291+
# mypy
291292
# pep517
292293
# pytest
293294
# tox
@@ -301,23 +302,31 @@ traitlets==4.3.3
301302
# ipython
302303
twine==3.4.1
303304
# via -r requirements/tools.in
304-
typed-ast==1.4.3
305-
# via mypy
305+
types-click==7.1.1
306+
# via -r requirements/tools.in
307+
types-pkg-resources==0.1.2
308+
# via -r requirements/tools.in
309+
types-pytz==0.1.1
310+
# via -r requirements/tools.in
311+
types-redis==3.5.1
312+
# via -r requirements/tools.in
306313
typing-extensions==3.10.0.0
307314
# via
308315
# libcst
309316
# mypy
310317
# typing-inspect
311318
typing-inspect==0.7.1
312319
# via libcst
313-
urllib3==1.26.5
320+
urllib3==1.26.6
314321
# via requests
315322
virtualenv==20.4.7
316323
# via tox
317324
wcwidth==0.2.5
318325
# via prompt-toolkit
319326
webencodings==0.5.1
320327
# via bleach
328+
wheel==0.36.2
329+
# via pip-tools
321330
zipp==3.4.1
322331
# via importlib-metadata
323332

whole-repo-tests/test_deploy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"project", [p for p in tools.all_projects() if p.has_release()]
2525
)
2626
def test_release_file_exists_and_is_valid(project, monkeypatch):
27-
assert not tools.has_uncommitted_changes(project.BASE_DIR)
27+
if not tools.has_uncommitted_changes(project.BASE_DIR):
28+
pytest.xfail("Cannot run release process with uncommitted changes")
2829

2930
monkeypatch.setattr(tools, "create_tag", lambda *args, **kwargs: None)
3031
monkeypatch.setattr(tools, "push_tag", lambda name: None)

0 commit comments

Comments
 (0)