Skip to content

Commit

Permalink
Merge pull request #4104 from Zac-HD/update-deps
Browse files Browse the repository at this point in the history
Update dependencies + test cleanups
  • Loading branch information
Zac-HD authored Sep 16, 2024
2 parents a64b71c + 1caa0f2 commit 4d079f7
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 81 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ jobs:
strategy:
matrix:
python:
- version: "3.9"
- version: "3.11"
- version: "3.11"
architecture: "x86"
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ if [ -n "${GITHUB_ACTIONS-}" ] || [ -n "${CODESPACES-}" ] ; then
else
# Otherwise, we install it from scratch
# NOTE: tooling keeps this version in sync with ci_version in tooling
"$SCRIPTS/ensure-python.sh" 3.10.14
PYTHON=$(pythonloc 3.10.14)/bin/python
"$SCRIPTS/ensure-python.sh" 3.10.15
PYTHON=$(pythonloc 3.10.15)/bin/python
fi

TOOL_REQUIREMENTS="$ROOT/requirements/tools.txt"
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def local_file(name):
"pytest": ["pytest>=4.6"],
"dpcontracts": ["dpcontracts>=0.4"],
"redis": ["redis>=3.0.0"],
"crosshair": ["hypothesis-crosshair>=0.0.13", "crosshair-tool>=0.0.70"],
"crosshair": ["hypothesis-crosshair>=0.0.14", "crosshair-tool>=0.0.71"],
# zoneinfo is an odd one: every dependency is conditional, because they're
# only necessary on old versions of Python or Windows systems or emscripten.
"zoneinfo": [
Expand Down
1 change: 0 additions & 1 deletion hypothesis-python/tests/cover/test_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ def test_fullmatch_generates_example(pattern, matching_str):
find_any(
st.from_regex(pattern, fullmatch=True),
lambda s: s == matching_str,
settings(max_examples=10**6),
)


Expand Down
3 changes: 1 addition & 2 deletions hypothesis-python/tests/nocover/test_complex_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@

import pytest

from hypothesis import given, settings, strategies as st
from hypothesis import given, strategies as st


@pytest.mark.parametrize("width", [32, 64, 128])
@pytest.mark.parametrize("keyword", ["min_magnitude", "max_magnitude"])
@given(data=st.data())
@settings(max_examples=1000)
def test_magnitude_validates(width, keyword, data):
# See https://github.com/HypothesisWorks/hypothesis/issues/3573
component_width = width / 2
Expand Down
13 changes: 7 additions & 6 deletions hypothesis-python/tests/nocover/test_database_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ def condition(x):
invalid.add(value)
with deterministic_PRNG():
stuff()

assert len(all_values(database)) < original


def test_respects_max_examples_in_database_usage():
key = b"a database key"
database = InMemoryExampleDatabase()
do_we_care = True
counter = [0]
counter = 0

def check(x):
counter[0] += 1
nonlocal counter
counter += 1
return do_we_care and has_a_non_zero_byte(x)

def stuff():
Expand All @@ -129,9 +129,10 @@ def stuff():
stuff()
assert len(all_values(database)) > 10
do_we_care = False
counter[0] = 0
stuff()
assert counter == [10]
counter = 0
with deterministic_PRNG():
stuff()
assert counter == 10


def test_does_not_use_database_when_seed_is_forced(monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/tests/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
import warnings

with warnings.catch_warnings():
warnings.simplefilter("ignore", EncodingWarning)
warnings.simplefilter("ignore", EncodingWarning) # noqa # not undefined
import numpy.testing # noqa
2 changes: 1 addition & 1 deletion hypothesis-python/tests/numpy/test_from_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_is_t(x):
test_is_t()


@settings(max_examples=100)
@settings(max_examples=100, deadline=None)
@given(nps.nested_dtypes(max_itemsize=400), st.data())
def test_infer_strategy_from_dtype(dtype, data):
# Given a dtype
Expand Down
3 changes: 1 addition & 2 deletions requirements/coverage.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ libcst
numpy
pandas
pyarrow # Silence warning from Pandas >=2.2, <3 - see https://github.com/pandas-dev/pandas/issues/54466
pytest-cov
python-dateutil
pytz
typing-extensions
-r test.in
# Need the unreleased compatibility fix for pytest-xdist rsyncdirs deprecation
git+https://github.com/pytest-dev/pytest-cov.git@9757222e2e044361e70125ebdd96e5eb87395983
16 changes: 9 additions & 7 deletions requirements/coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ annotated-types==0.7.0
async-timeout==4.0.3
# via redis
attrs==24.1.0
# via hypothesis (hypothesis-python/setup.py)
# via
# -r requirements/test.in
# hypothesis (hypothesis-python/setup.py)
black==24.8.0
# via -r requirements/coverage.in
click==8.1.7
Expand All @@ -26,7 +28,7 @@ exceptiongroup==1.2.2 ; python_version < "3.11"
# pytest
execnet==2.1.1
# via pytest-xdist
fakeredis==2.23.5
fakeredis==2.24.1
# via -r requirements/coverage.in
iniconfig==2.0.0
# via pytest
Expand All @@ -36,7 +38,7 @@ libcst==1.4.0
# via -r requirements/coverage.in
mypy-extensions==1.0.0
# via black
numpy==2.0.1
numpy==2.1.1
# via
# -r requirements/coverage.in
# pandas
Expand All @@ -51,28 +53,28 @@ pathspec==0.12.1
# via black
pexpect==4.9.0
# via -r requirements/test.in
platformdirs==4.2.2
platformdirs==4.3.3
# via black
pluggy==1.5.0
# via pytest
ptyprocess==0.7.0
# via pexpect
pyarrow==17.0.0
# via -r requirements/coverage.in
pytest==8.3.2
pytest==8.3.3
# via
# -r requirements/test.in
# pytest-cov
# pytest-xdist
pytest-cov @ git+https://github.com/pytest-dev/pytest-cov.git@9757222e2e044361e70125ebdd96e5eb87395983
pytest-cov==5.0.0
# via -r requirements/coverage.in
pytest-xdist==3.6.1
# via -r requirements/test.in
python-dateutil==2.9.0.post0
# via
# -r requirements/coverage.in
# pandas
pytz==2024.1
pytz==2024.2
# via
# -r requirements/coverage.in
# pandas
Expand Down
35 changes: 18 additions & 17 deletions requirements/fuzzing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ async-timeout==4.0.3
# via redis
attrs==24.1.0
# via
# -r requirements/test.in
# hypothesis
# hypothesis (hypothesis-python/setup.py)
black==24.8.0
Expand All @@ -19,7 +20,7 @@ black==24.8.0
# hypothesis
blinker==1.8.2
# via flask
certifi==2024.7.4
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
# via requests
Expand All @@ -33,7 +34,7 @@ coverage[toml]==7.6.1
# via
# hypofuzz
# pytest-cov
dash==2.17.1
dash==2.18.1
# via hypofuzz
dash-core-components==2.0.0
# via dash
Expand All @@ -50,17 +51,17 @@ exceptiongroup==1.2.2 ; python_version < "3.11"
# pytest
execnet==2.1.1
# via pytest-xdist
fakeredis==2.23.5
fakeredis==2.24.1
# via -r requirements/coverage.in
flask==3.0.3
# via dash
hypofuzz==24.2.3
# via -r requirements/fuzzing.in
hypothesis[cli]==6.111.1
hypothesis[cli]==6.112.1
# via hypofuzz
idna==3.7
idna==3.10
# via requests
importlib-metadata==8.2.0
importlib-metadata==8.5.0
# via dash
iniconfig==2.0.0
# via pytest
Expand All @@ -86,7 +87,7 @@ mypy-extensions==1.0.0
# via black
nest-asyncio==1.6.0
# via dash
numpy==2.0.1
numpy==2.1.1
# via
# -r requirements/coverage.in
# pandas
Expand All @@ -104,9 +105,9 @@ pathspec==0.12.1
# via black
pexpect==4.9.0
# via -r requirements/test.in
platformdirs==4.2.2
platformdirs==4.3.3
# via black
plotly==5.23.0
plotly==5.24.1
# via dash
pluggy==1.5.0
# via pytest
Expand All @@ -118,21 +119,21 @@ pyarrow==17.0.0
# via -r requirements/coverage.in
pygments==2.18.0
# via rich
pytest==8.3.2
pytest==8.3.3
# via
# -r requirements/test.in
# hypofuzz
# pytest-cov
# pytest-xdist
pytest-cov @ git+https://github.com/pytest-dev/pytest-cov.git@9757222e2e044361e70125ebdd96e5eb87395983
pytest-cov==5.0.0
# via -r requirements/coverage.in
pytest-xdist==3.6.1
# via -r requirements/test.in
python-dateutil==2.9.0.post0
# via
# -r requirements/coverage.in
# pandas
pytz==2024.1
pytz==2024.2
# via
# -r requirements/coverage.in
# pandas
Expand All @@ -146,7 +147,7 @@ requests==2.32.3
# hypofuzz
retrying==1.3.4
# via dash
rich==13.7.1
rich==13.8.1
# via hypothesis
six==1.16.0
# via
Expand All @@ -172,15 +173,15 @@ typing-extensions==4.12.2
# fakeredis
tzdata==2024.1
# via pandas
urllib3==2.2.2
urllib3==2.2.3
# via requests
werkzeug==3.0.3
werkzeug==3.0.4
# via
# dash
# flask
zipp==3.20.0
zipp==3.20.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==72.2.0
setuptools==75.0.0
# via dash
1 change: 1 addition & 0 deletions requirements/test.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
attrs==24.1.0 # too early for https://github.com/python-attrs/attrs/pull/1329
pexpect
pytest
pytest-xdist
6 changes: 4 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# ./build.sh upgrade-requirements
#
attrs==24.1.0
# via hypothesis (hypothesis-python/setup.py)
# via
# -r requirements/test.in
# hypothesis (hypothesis-python/setup.py)
exceptiongroup==1.2.2 ; python_version < "3.11"
# via
# hypothesis (hypothesis-python/setup.py)
Expand All @@ -22,7 +24,7 @@ pluggy==1.5.0
# via pytest
ptyprocess==0.7.0
# via pexpect
pytest==8.3.2
pytest==8.3.3
# via
# -r requirements/test.in
# pytest-xdist
Expand Down
Loading

0 comments on commit 4d079f7

Please sign in to comment.