From 50789d377dde718db22db3a6fb0c95436462dd5f Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sat, 27 Apr 2024 19:32:13 -0700 Subject: [PATCH 1/3] Keep ellipses --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3b38545b9b..a160dc9d9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ ignore = [ "FBT003", "PD011", "PD901", + "PIE790", # See https://github.com/astral-sh/ruff/issues/10538 "PT001", "PT003", "PT006", From a98771f6e8295bd3672006d2d3cbd996d3d10010 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sat, 27 Apr 2024 20:15:43 -0700 Subject: [PATCH 2/3] Update pinned dependencies --- .github/workflows/main.yml | 2 +- hypothesis-python/src/hypothesis/errors.py | 1 + .../src/hypothesis/utils/conventions.py | 1 + .../tests/array_api/test_arrays.py | 1 + .../tests/array_api/test_partial_adoptors.py | 4 +- .../tests/cover/test_database_backend.py | 4 +- .../tests/numpy/test_from_dtype.py | 1 + requirements/coverage.txt | 34 +++---- requirements/fuzzing.txt | 50 +++++----- requirements/test.txt | 8 +- requirements/tools.in | 2 +- requirements/tools.txt | 98 ++++++++++--------- 12 files changed, 103 insertions(+), 103 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7538458670..431f6cb2cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -208,7 +208,7 @@ jobs: NODE_VERSION: 18 # Note that the versions below must be updated in sync; we've automated # that with `update_pyodide_versions()` in our weekly cronjob. - PYODIDE_VERSION: 0.25.0 + PYODIDE_VERSION: 0.25.1 PYTHON_VERSION: 3.11.3 EMSCRIPTEN_VERSION: 3.1.46 steps: diff --git a/hypothesis-python/src/hypothesis/errors.py b/hypothesis-python/src/hypothesis/errors.py index d71f1c337e..0d376a7493 100644 --- a/hypothesis-python/src/hypothesis/errors.py +++ b/hypothesis-python/src/hypothesis/errors.py @@ -8,6 +8,7 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. + class HypothesisException(Exception): """Generic parent class for exceptions thrown by Hypothesis.""" diff --git a/hypothesis-python/src/hypothesis/utils/conventions.py b/hypothesis-python/src/hypothesis/utils/conventions.py index ead205adc6..ec01326b49 100644 --- a/hypothesis-python/src/hypothesis/utils/conventions.py +++ b/hypothesis-python/src/hypothesis/utils/conventions.py @@ -8,6 +8,7 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. + class UniqueIdentifier: """A factory for sentinel objects with nice reprs.""" diff --git a/hypothesis-python/tests/array_api/test_arrays.py b/hypothesis-python/tests/array_api/test_arrays.py index c9fe8e28ce..893bc43368 100644 --- a/hypothesis-python/tests/array_api/test_arrays.py +++ b/hypothesis-python/tests/array_api/test_arrays.py @@ -301,6 +301,7 @@ def test_may_not_fill_unique_array_with_non_nan(xp, xps): @pytest.mark.skipif(sys.version_info[:2] <= (3, 8), reason="no complex") def test_floating_point_array(): import warnings + from hypothesis.extra.array_api import make_strategies_namespace try: diff --git a/hypothesis-python/tests/array_api/test_partial_adoptors.py b/hypothesis-python/tests/array_api/test_partial_adoptors.py index 422b109acf..7e6531e46d 100644 --- a/hypothesis-python/tests/array_api/test_partial_adoptors.py +++ b/hypothesis-python/tests/array_api/test_partial_adoptors.py @@ -8,11 +8,11 @@ # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. +import functools +import warnings from copy import copy from types import SimpleNamespace from typing import Tuple -import functools -import warnings import pytest diff --git a/hypothesis-python/tests/cover/test_database_backend.py b/hypothesis-python/tests/cover/test_database_backend.py index f0b2fa0e8f..19d33d2df1 100644 --- a/hypothesis-python/tests/cover/test_database_backend.py +++ b/hypothesis-python/tests/cover/test_database_backend.py @@ -17,12 +17,10 @@ from pathlib import Path from shutil import make_archive, rmtree from typing import Iterator, Optional, Tuple -from hypothesis.internal.compat import WINDOWS import pytest from hypothesis import configuration, given, settings, strategies as st -from hypothesis.utils.conventions import not_set from hypothesis.database import ( DirectoryBasedExampleDatabase, ExampleDatabase, @@ -32,8 +30,10 @@ ReadOnlyDatabase, ) from hypothesis.errors import HypothesisWarning +from hypothesis.internal.compat import WINDOWS from hypothesis.stateful import Bundle, RuleBasedStateMachine, rule from hypothesis.strategies import binary, lists, tuples +from hypothesis.utils.conventions import not_set small_settings = settings(max_examples=50) diff --git a/hypothesis-python/tests/numpy/test_from_dtype.py b/hypothesis-python/tests/numpy/test_from_dtype.py index 4316f00577..40e905cdc1 100644 --- a/hypothesis-python/tests/numpy/test_from_dtype.py +++ b/hypothesis-python/tests/numpy/test_from_dtype.py @@ -130,6 +130,7 @@ def test_byte_string_dtypes_generate_unicode_strings(data): skipif_np2 = pytest.mark.skipif(np_version >= (2, 0), reason="removed in new version") + @pytest.mark.parametrize( "dtype", ["U", "S", pytest.param("a", marks=skipif_np2)], diff --git a/requirements/coverage.txt b/requirements/coverage.txt index b5d3c83431..b7ee98aa62 100644 --- a/requirements/coverage.txt +++ b/requirements/coverage.txt @@ -10,34 +10,32 @@ async-timeout==4.0.3 # via redis attrs==23.2.0 # via hypothesis (hypothesis-python/setup.py) -black==24.3.0 +black==24.4.2 # via -r requirements/coverage.in click==8.1.7 # via # -r requirements/coverage.in # black -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via pytest-cov dpcontracts==0.6.0 # via -r requirements/coverage.in -exceptiongroup==1.2.0 ; python_version < "3.11" +exceptiongroup==1.2.1 ; python_version < "3.11" # via # hypothesis (hypothesis-python/setup.py) # pytest -execnet==2.0.2 +execnet==2.1.1 # via pytest-xdist -fakeredis==2.21.3 +fakeredis==2.22.0 # via -r requirements/coverage.in iniconfig==2.0.0 # via pytest lark==1.1.9 # via -r requirements/coverage.in -libcst==1.2.0 +libcst==1.3.1 # via -r requirements/coverage.in mypy-extensions==1.0.0 - # via - # black - # typing-inspect + # via black numpy==1.26.4 # via # -r requirements/coverage.in @@ -47,21 +45,21 @@ packaging==24.0 # via # black # pytest -pandas==2.2.1 +pandas==2.2.2 # via -r requirements/coverage.in pathspec==0.12.1 # via black pexpect==4.9.0 # via -r requirements/test.in -platformdirs==4.2.0 +platformdirs==4.2.1 # via black -pluggy==1.4.0 +pluggy==1.5.0 # via pytest ptyprocess==0.7.0 # via pexpect -pyarrow==15.0.2 +pyarrow==16.0.0 # via -r requirements/coverage.in -pytest==8.1.1 +pytest==8.2.0 # via # -r requirements/test.in # pytest-cov @@ -80,7 +78,7 @@ pytz==2024.1 # pandas pyyaml==6.0.1 # via libcst -redis==5.0.3 +redis==5.0.4 # via fakeredis six==1.16.0 # via python-dateutil @@ -93,13 +91,9 @@ tomli==2.0.1 # black # coverage # pytest -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/coverage.in # black - # libcst - # typing-inspect -typing-inspect==0.9.0 - # via libcst tzdata==2024.1 # via pandas diff --git a/requirements/fuzzing.txt b/requirements/fuzzing.txt index ca66d479ae..953c79cbd9 100644 --- a/requirements/fuzzing.txt +++ b/requirements/fuzzing.txt @@ -12,12 +12,12 @@ attrs==23.2.0 # via # hypothesis # hypothesis (hypothesis-python/setup.py) -black==24.3.0 +black==24.4.2 # via # -r requirements/coverage.in # hypofuzz # hypothesis -blinker==1.7.0 +blinker==1.8.0 # via flask certifi==2024.2.2 # via requests @@ -29,7 +29,7 @@ click==8.1.7 # black # flask # hypothesis -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via # hypofuzz # pytest-cov @@ -43,34 +43,34 @@ dash-table==5.0.0 # via dash dpcontracts==0.6.0 # via -r requirements/coverage.in -exceptiongroup==1.2.0 ; python_version < "3.11" +exceptiongroup==1.2.1 ; python_version < "3.11" # via # hypothesis # hypothesis (hypothesis-python/setup.py) # pytest -execnet==2.0.2 +execnet==2.1.1 # via pytest-xdist -fakeredis==2.21.3 +fakeredis==2.22.0 # via -r requirements/coverage.in -flask==3.0.2 +flask==3.0.3 # via dash hypofuzz==24.2.3 # via -r requirements/fuzzing.in -hypothesis[cli]==6.99.12 +hypothesis[cli]==6.100.1 # via hypofuzz -idna==3.6 +idna==3.7 # via requests importlib-metadata==7.1.0 # via dash iniconfig==2.0.0 # via pytest -itsdangerous==2.1.2 +itsdangerous==2.2.0 # via flask jinja2==3.1.3 # via flask lark==1.1.9 # via -r requirements/coverage.in -libcst==1.2.0 +libcst==1.3.1 # via # -r requirements/coverage.in # hypofuzz @@ -83,9 +83,7 @@ markupsafe==2.1.5 mdurl==0.1.2 # via markdown-it-py mypy-extensions==1.0.0 - # via - # black - # typing-inspect + # via black nest-asyncio==1.6.0 # via dash numpy==1.26.4 @@ -98,7 +96,7 @@ packaging==24.0 # black # plotly # pytest -pandas==2.2.1 +pandas==2.2.2 # via # -r requirements/coverage.in # hypofuzz @@ -106,21 +104,21 @@ pathspec==0.12.1 # via black pexpect==4.9.0 # via -r requirements/test.in -platformdirs==4.2.0 +platformdirs==4.2.1 # via black -plotly==5.20.0 +plotly==5.21.0 # via dash -pluggy==1.4.0 +pluggy==1.5.0 # via pytest psutil==5.9.8 # via hypofuzz ptyprocess==0.7.0 # via pexpect -pyarrow==15.0.2 +pyarrow==16.0.0 # via -r requirements/coverage.in pygments==2.17.2 # via rich -pytest==8.1.1 +pytest==8.2.0 # via # -r requirements/test.in # hypofuzz @@ -140,7 +138,7 @@ pytz==2024.1 # pandas pyyaml==6.0.1 # via libcst -redis==5.0.3 +redis==5.0.4 # via fakeredis requests==2.31.0 # via @@ -166,20 +164,16 @@ tomli==2.0.1 # black # coverage # pytest -typing-extensions==4.10.0 +typing-extensions==4.11.0 # via # -r requirements/coverage.in # black # dash - # libcst - # typing-inspect -typing-inspect==0.9.0 - # via libcst tzdata==2024.1 # via pandas urllib3==2.2.1 # via requests -werkzeug==3.0.1 +werkzeug==3.0.2 # via # dash # flask @@ -187,5 +181,5 @@ zipp==3.18.1 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: -setuptools==69.2.0 +setuptools==69.5.1 # via dash diff --git a/requirements/test.txt b/requirements/test.txt index cff3f77eb2..076f59556e 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -6,11 +6,11 @@ # attrs==23.2.0 # via hypothesis (hypothesis-python/setup.py) -exceptiongroup==1.2.0 ; python_version < "3.11" +exceptiongroup==1.2.1 ; python_version < "3.11" # via # hypothesis (hypothesis-python/setup.py) # pytest -execnet==2.0.2 +execnet==2.1.1 # via pytest-xdist iniconfig==2.0.0 # via pytest @@ -18,11 +18,11 @@ packaging==24.0 # via pytest pexpect==4.9.0 # via -r requirements/test.in -pluggy==1.4.0 +pluggy==1.5.0 # via pytest ptyprocess==0.7.0 # via pexpect -pytest==8.1.1 +pytest==8.2.0 # via # -r requirements/test.in # pytest-xdist diff --git a/requirements/tools.in b/requirements/tools.in index 4359bac1ad..5baa5a4690 100644 --- a/requirements/tools.in +++ b/requirements/tools.in @@ -15,7 +15,7 @@ python-dateutil requests restructuredtext-lint ruff -shed +shed==2024.1.1 sphinx sphinx-codeautolink sphinx-hoverxref diff --git a/requirements/tools.txt b/requirements/tools.txt index c5f30a4e4e..023177a402 100644 --- a/requirements/tools.txt +++ b/requirements/tools.txt @@ -14,15 +14,19 @@ asttokens==2.4.1 # via stack-data attrs==23.2.0 # via hypothesis (hypothesis-python/setup.py) +autoflake==2.3.1 + # via shed babel==2.14.0 # via sphinx +backports-tarfile==1.1.1 + # via jaraco-context beautifulsoup4==4.12.3 # via sphinx-codeautolink -black==24.3.0 +black==24.4.2 # via shed -blinker==1.7.0 +blinker==1.8.0 # via pelican -build==1.1.1 +build==1.2.1 # via pip-tools cachetools==5.3.3 # via tox @@ -44,7 +48,7 @@ colorama==0.4.6 # via tox com2ann==0.3.0 # via shed -coverage==7.4.4 +coverage==7.5.0 # via -r requirements/tools.in cryptography==42.0.5 # via @@ -55,7 +59,7 @@ decorator==5.1.1 # via ipython distlib==0.3.8 # via virtualenv -django==5.0.3 +django==5.0.4 # via -r requirements/tools.in docutils==0.20.1 # via @@ -67,7 +71,7 @@ docutils==0.20.1 # sphinx-rtd-theme dpcontracts==0.6.0 # via -r requirements/tools.in -exceptiongroup==1.2.0 ; python_version < "3.11" +exceptiongroup==1.2.1 ; python_version < "3.11" # via # anyio # hypothesis (hypothesis-python/setup.py) @@ -77,11 +81,11 @@ executing==2.0.1 # via stack-data feedgenerator==2.1.0 # via pelican -filelock==3.13.1 +filelock==3.13.4 # via # tox # virtualenv -idna==3.6 +idna==3.7 # via # anyio # requests @@ -93,13 +97,15 @@ importlib-metadata==7.1.0 # twine iniconfig==2.0.0 # via pytest -ipython==8.22.2 +ipython==8.24.0 # via -r requirements/tools.in -jaraco-classes==3.3.1 +isort==5.13.2 + # via shed +jaraco-classes==3.4.0 # via keyring -jaraco-context==4.3.0 +jaraco-context==5.3.0 # via keyring -jaraco-functools==4.0.0 +jaraco-functools==4.0.1 # via keyring jedi==0.19.1 # via ipython @@ -113,11 +119,11 @@ jinja2==3.1.3 # sphinx jsonpointer==2.4 # via sphinx-jsonschema -keyring==25.0.0 +keyring==25.2.0 # via twine lark==1.1.9 # via -r requirements/tools.in -libcst==1.2.0 +libcst==1.3.1 # via # -r requirements/tools.in # shed @@ -127,7 +133,7 @@ markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 # via jinja2 -matplotlib-inline==0.1.6 +matplotlib-inline==0.1.7 # via ipython mdurl==0.1.2 # via markdown-it-py @@ -135,14 +141,13 @@ more-itertools==10.2.0 # via # jaraco-classes # jaraco-functools -mypy==1.9.0 +mypy==1.10.0 # via -r requirements/tools.in mypy-extensions==1.0.0 # via # black # mypy - # typing-inspect -nh3==0.2.15 +nh3==0.2.17 # via readme-renderer nodeenv==1.8.0 # via pyright @@ -158,7 +163,7 @@ packaging==24.0 # pytest # sphinx # tox -parso==0.8.3 +parso==0.8.4 # via jedi pathspec==0.12.1 # via black @@ -170,12 +175,12 @@ pip-tools==7.4.1 # via -r requirements/tools.in pkginfo==1.10.0 # via twine -platformdirs==4.2.0 +platformdirs==4.2.1 # via # black # tox # virtualenv -pluggy==1.4.0 +pluggy==1.5.0 # via # pytest # tox @@ -185,8 +190,10 @@ ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -pycparser==2.21 +pycparser==2.22 # via cffi +pyflakes==3.2.0 + # via autoflake pygments==2.17.2 # via # ipython @@ -200,9 +207,9 @@ pyproject-hooks==1.0.0 # via # build # pip-tools -pyright==1.1.355 +pyright==1.1.360 # via -r requirements/tools.in -pytest==8.1.1 +pytest==8.2.0 # via -r requirements/tools.in python-dateutil==2.9.0.post0 # via @@ -210,7 +217,7 @@ python-dateutil==2.9.0.post0 # pelican pytz==2024.1 # via feedgenerator -pyupgrade==3.15.1 +pyupgrade==3.15.2 # via shed pyyaml==6.0.1 # via @@ -235,13 +242,11 @@ rich==13.7.1 # via # pelican # twine -ruff==0.3.3 - # via - # -r requirements/tools.in - # shed +ruff==0.4.2 + # via -r requirements/tools.in secretstorage==3.3.3 # via keyring -shed==2024.3.1 +shed==2024.1.1 # via -r requirements/tools.in six==1.16.0 # via @@ -255,14 +260,14 @@ sortedcontainers==2.4.0 # via hypothesis (hypothesis-python/setup.py) soupsieve==2.5 # via beautifulsoup4 -sphinx==7.2.6 +sphinx==7.3.7 # via # -r requirements/tools.in # sphinx-codeautolink # sphinx-hoverxref # sphinx-rtd-theme # sphinxcontrib-jquery -sphinx-codeautolink==0.15.0 +sphinx-codeautolink==0.15.1 # via -r requirements/tools.in sphinx-hoverxref==1.3.0 # via -r requirements/tools.in @@ -288,7 +293,7 @@ sphinxcontrib-qthelp==1.0.7 # via sphinx sphinxcontrib-serializinghtml==1.1.10 # via sphinx -sqlparse==0.4.4 +sqlparse==0.5.0 # via django stack-data==0.6.3 # via ipython @@ -296,6 +301,7 @@ tokenize-rt==5.2.0 # via pyupgrade tomli==2.0.1 # via + # autoflake # black # build # mypy @@ -303,43 +309,45 @@ tomli==2.0.1 # pyproject-api # pyproject-hooks # pytest + # sphinx # tox -tox==4.14.2 +tox==4.15.0 # via -r requirements/tools.in -traitlets==5.14.2 +traitlets==5.14.3 # via # ipython # matplotlib-inline twine==5.0.0 # via -r requirements/tools.in +types-cffi==1.16.0.20240331 + # via types-pyopenssl types-click==7.1.8 # via -r requirements/tools.in types-pkg-resources==0.1.3 # via -r requirements/tools.in -types-pyopenssl==24.0.0.20240311 +types-pyopenssl==24.1.0.20240425 # via types-redis -types-pytz==2024.1.0.20240203 +types-pytz==2024.1.0.20240417 # via -r requirements/tools.in -types-redis==4.6.0.20240311 +types-redis==4.6.0.20240425 # via -r requirements/tools.in -typing-extensions==4.10.0 +types-setuptools==69.5.0.20240423 + # via types-cffi +typing-extensions==4.11.0 # via # -r requirements/tools.in # anyio # asgiref # black - # libcst + # ipython # mypy - # typing-inspect -typing-inspect==0.9.0 - # via libcst unidecode==1.3.8 # via pelican urllib3==2.2.1 # via # requests # twine -virtualenv==20.25.1 +virtualenv==20.26.0 # via tox watchfiles==0.21.0 # via pelican @@ -353,7 +361,7 @@ zipp==3.18.1 # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via pip-tools -setuptools==69.2.0 +setuptools==69.5.1 # via # nodeenv # pip-tools From f449cf96f1cbd17320f4e2c03ad02881bc1ebeb5 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sat, 27 Apr 2024 20:55:54 -0700 Subject: [PATCH 3/3] Various final fixes --- hypothesis-python/scripts/other-tests.sh | 2 +- hypothesis-python/tests/conjecture/test_ir.py | 1 + tooling/src/hypothesistooling/__main__.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hypothesis-python/scripts/other-tests.sh b/hypothesis-python/scripts/other-tests.sh index cbeda25fa7..4e24e51c11 100644 --- a/hypothesis-python/scripts/other-tests.sh +++ b/hypothesis-python/scripts/other-tests.sh @@ -26,10 +26,10 @@ $PYTEST tests/dpcontracts/ pip uninstall -y dpcontracts pip install "$(grep 'fakeredis==' ../requirements/coverage.txt)" +pip install "$(grep 'typing-extensions==' ../requirements/coverage.txt)" $PYTEST tests/redis/ pip uninstall -y redis fakeredis -pip install "$(grep 'typing-extensions==' ../requirements/coverage.txt)" $PYTEST tests/typing_extensions/ pip uninstall -y typing_extensions diff --git a/hypothesis-python/tests/conjecture/test_ir.py b/hypothesis-python/tests/conjecture/test_ir.py index fa29999739..a3ccd1404d 100644 --- a/hypothesis-python/tests/conjecture/test_ir.py +++ b/hypothesis-python/tests/conjecture/test_ir.py @@ -406,6 +406,7 @@ def test_node_with_same_ir_type_but_different_value_is_invalid(data): @given(st.data()) +@settings(suppress_health_check=[HealthCheck.too_slow]) def test_data_with_changed_was_forced(data): # we had a normal node and then tried to draw a different forced value from it. # ir tree: v1 [was_forced=False] diff --git a/tooling/src/hypothesistooling/__main__.py b/tooling/src/hypothesistooling/__main__.py index 9a2db040b9..7091c6b361 100644 --- a/tooling/src/hypothesistooling/__main__.py +++ b/tooling/src/hypothesistooling/__main__.py @@ -432,7 +432,7 @@ def run_tox(task, version, *args): "3.10": "3.10.14", "3.11": "3.11.8", "3.12": "3.12.2", - "3.13": "3.13.0a5", + "3.13": "3.13.0a6", "pypy3.8": "pypy3.8-7.3.11", "pypy3.9": "pypy3.9-7.3.15", "pypy3.10": "pypy3.10-7.3.15",