Skip to content

Commit

Permalink
Merge pull request #3022 from HypothesisWorks/create-pull-request/patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD authored Jul 2, 2021
2 parents 5181a22 + 2567162 commit acbaf9e
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 48 deletions.
4 changes: 4 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RELEASE_TYPE: patch

This patch updates some internal type annotations.
There is no user-visible change.
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/extra/codemods.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class HypothesisFixComplexMinMagnitude(VisitorBasedCodemodCommand):
METADATA_DEPENDENCIES = (cst.metadata.QualifiedNameProvider,)

@m.call_if_inside(
m.Call(metadata=match_qualname("hypothesis.strategies.complex_numbers"))
m.Call(metadata=match_qualname("hypothesis.strategies.complex_numbers")) # type: ignore
)
def leave_Arg(self, original_node, updated_node):
if m.matches(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def lists(
and len(unique_by) == 1
and (
# Introspection for either `itemgetter(0)`, or `lambda x: x[0]`
isinstance(unique_by[0], operator.itemgetter) # type: ignore
isinstance(unique_by[0], operator.itemgetter)
and repr(unique_by[0]) == "operator.itemgetter(0)"
or isinstance(unique_by[0], FunctionType)
and re.fullmatch(
Expand Down Expand Up @@ -858,9 +858,6 @@ def builds(
)
for kw in set(hints) & (required | to_infer):
kwargs[kw] = from_type(hints[kw])

# Mypy doesn't realise that `infer` is gone from kwargs now
# and thinks that target and args have the same (union) type.
return BuildsStrategy(target, args, kwargs)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ def _networks(bits):
UnicodeTranslateError, st.text(), st.just(0), st.just(0), st.just("reason")
),
enumerate: st.builds(enumerate, st.just(())),
filter: st.builds(filter, st.just(lambda _: None), st.just(())), # type: ignore
map: st.builds(map, st.just(lambda _: None), st.just(())), # type: ignore
reversed: st.builds(reversed, st.just(())), # type: ignore
filter: st.builds(filter, st.just(lambda _: None), st.just(())),
map: st.builds(map, st.just(lambda _: None), st.just(())),
reversed: st.builds(reversed, st.just(())),
classmethod: st.builds(classmethod, st.just(lambda self: self)),
staticmethod: st.builds(staticmethod, st.just(lambda self: self)),
super: st.builds(super, st.from_type(type)),
Expand Down
6 changes: 3 additions & 3 deletions requirements/coverage.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/coverage.txt hypothesis-python/setup.py requirements/coverage.in
Expand All @@ -10,11 +10,11 @@ coverage==5.5
# via -r requirements/coverage.in
lark-parser==0.11.3
# via -r requirements/coverage.in
numpy==1.20.3
numpy==1.21.0
# via
# -r requirements/coverage.in
# pandas
pandas==1.2.4
pandas==1.2.5
# via -r requirements/coverage.in
python-dateutil==2.8.1
# via pandas
Expand Down
14 changes: 6 additions & 8 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/test.txt hypothesis-python/setup.py requirements/test.in
#
apipkg==1.5
# via execnet
attrs==21.2.0
# via
# hypothesis (hypothesis-python/setup.py)
# pytest
execnet==1.8.1
execnet==1.9.0
# via pytest-xdist
iniconfig==1.1.1
# via pytest
Expand All @@ -28,15 +26,15 @@ py==1.10.0
# pytest-forked
pyparsing==2.4.7
# via packaging
pytest-forked==1.3.0
# via pytest-xdist
pytest-xdist==2.2.1
# via -r requirements/test.in
pytest==6.2.4
# via
# -r requirements/test.in
# pytest-forked
# pytest-xdist
pytest-forked==1.3.0
# via pytest-xdist
pytest-xdist==2.3.0
# via -r requirements/test.in
sortedcontainers==2.4.0
# via hypothesis (hypothesis-python/setup.py)
toml==0.10.2
Expand Down
4 changes: 4 additions & 0 deletions requirements/tools.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ toml
tox
traitlets < 5.0 # drops support for Python 3.6
twine
types-click
types-pkg_resources
types-pytz
types-redis
65 changes: 37 additions & 28 deletions requirements/tools.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/tools.txt hypothesis-python/setup.py requirements/tools.in
Expand Down Expand Up @@ -75,6 +75,16 @@ filelock==3.0.12
# via
# tox
# virtualenv
flake8==3.9.2
# via
# -r requirements/tools.in
# flake8-2020
# flake8-bandit
# flake8-bugbear
# flake8-comprehensions
# flake8-docstrings
# flake8-mutable
# flake8-polyfill
flake8-2020==1.6.0
# via -r requirements/tools.in
flake8-bandit==2.1.2
Expand All @@ -89,19 +99,9 @@ flake8-mutable==1.2.0
# via -r requirements/tools.in
flake8-polyfill==1.0.2
# via flake8-bandit
flake8==3.9.2
# via
# -r requirements/tools.in
# flake8-2020
# flake8-bandit
# flake8-bugbear
# flake8-comprehensions
# flake8-docstrings
# flake8-mutable
# flake8-polyfill
gitdb==4.0.7
# via gitpython
gitpython==3.1.17
gitpython==3.1.18
# via bandit
idna==2.10
# via requests
Expand All @@ -113,11 +113,11 @@ importlib-metadata==4.5.0
# twine
iniconfig==1.1.1
# via pytest
ipython-genutils==0.2.0
# via traitlets
ipython==7.16.1
# via -r requirements/tools.in
isort==5.8.0
ipython-genutils==0.2.0
# via traitlets
isort==5.9.1
# via shed
jedi==0.18.0
# via ipython
Expand All @@ -140,13 +140,13 @@ markupsafe==2.0.1
# via jinja2
mccabe==0.6.1
# via flake8
mypy==0.910
# via -r requirements/tools.in
mypy-extensions==0.4.3
# via
# black
# mypy
# typing-inspect
mypy==0.812
# via -r requirements/tools.in
packaging==20.9
# via
# bleach
Expand All @@ -165,15 +165,15 @@ pexpect==4.8.0
# via ipython
pickleshare==0.7.5
# via ipython
pip-tools==6.1.0
pip-tools==6.2.0
# via -r requirements/tools.in
pkginfo==1.7.0
# via twine
pluggy==0.13.1
# via
# pytest
# tox
prompt-toolkit==3.0.18
prompt-toolkit==3.0.19
# via ipython
ptyprocess==0.7.0
# via pexpect
Expand Down Expand Up @@ -223,14 +223,14 @@ readme-renderer==29.0
# via twine
regex==2021.4.4
# via black
requests-toolbelt==0.9.1
# via twine
requests==2.25.1
# via
# -r requirements/tools.in
# requests-toolbelt
# sphinx
# twine
requests-toolbelt==0.9.1
# via twine
restructuredtext-lint==1.3.2
# via -r requirements/tools.in
rfc3986==1.5.0
Expand All @@ -256,16 +256,16 @@ snowballstemmer==2.1.0
# sphinx
sortedcontainers==2.4.0
# via hypothesis (hypothesis-python/setup.py)
sphinx==4.0.2
# via
# -r requirements/tools.in
# sphinx-rtd-theme
sphinx-hoverxref==0.6b1
# via -r requirements/tools.in
sphinx-rtd-theme==0.5.2
# via -r requirements/tools.in
sphinx-selective-exclude==1.0.3
# via -r requirements/tools.in
sphinx==4.0.2
# via
# -r requirements/tools.in
# sphinx-rtd-theme
sphinxcontrib-applehelp==1.0.2
# via sphinx
sphinxcontrib-devhelp==1.0.2
Expand All @@ -288,6 +288,7 @@ toml==0.10.2
# via
# -r requirements/tools.in
# black
# mypy
# pep517
# pytest
# tox
Expand All @@ -301,23 +302,31 @@ traitlets==4.3.3
# ipython
twine==3.4.1
# via -r requirements/tools.in
typed-ast==1.4.3
# via mypy
types-click==7.1.1
# via -r requirements/tools.in
types-pkg-resources==0.1.2
# via -r requirements/tools.in
types-pytz==0.1.1
# via -r requirements/tools.in
types-redis==3.5.1
# via -r requirements/tools.in
typing-extensions==3.10.0.0
# via
# libcst
# mypy
# typing-inspect
typing-inspect==0.7.1
# via libcst
urllib3==1.26.5
urllib3==1.26.6
# via requests
virtualenv==20.4.7
# via tox
wcwidth==0.2.5
# via prompt-toolkit
webencodings==0.5.1
# via bleach
wheel==0.36.2
# via pip-tools
zipp==3.4.1
# via importlib-metadata

Expand Down
3 changes: 2 additions & 1 deletion whole-repo-tests/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"project", [p for p in tools.all_projects() if p.has_release()]
)
def test_release_file_exists_and_is_valid(project, monkeypatch):
assert not tools.has_uncommitted_changes(project.BASE_DIR)
if not tools.has_uncommitted_changes(project.BASE_DIR):
pytest.xfail("Cannot run release process with uncommitted changes")

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

0 comments on commit acbaf9e

Please sign in to comment.