Skip to content

Commit

Permalink
Merge pull request HypothesisWorks#4087 from HypothesisWorks/create-p…
Browse files Browse the repository at this point in the history
…ull-request/patch

Update pinned dependencies
  • Loading branch information
Zac-HD authored Aug 20, 2024
2 parents 6c51f10 + 3346f25 commit c90732c
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 51 deletions.
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.12", "crosshair-tool>=0.0.66"],
"crosshair": ["hypothesis-crosshair>=0.0.13", "crosshair-tool>=0.0.68"],
# 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
55 changes: 28 additions & 27 deletions notebooks/Designing a better simplifier.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@
" \"\"\"\n",
" This is our prototype shrink function. It is very bad. It makes the\n",
" mistake of only making very small changes to an example each time.\n",
" \n",
"\n",
" Most people write something like this the first time they come to\n",
" implement example shrinking. In particular early Hypothesis very much\n",
" made this mistake.\n",
" \n",
"\n",
" What this does:\n",
" \n",
"\n",
" For each index, if the value of the index is non-zero we try\n",
" decrementing it by 1.\n",
" \n",
"\n",
" We then (regardless of if it's zero) try the list with the value at\n",
" that index deleted.\n",
" \"\"\"\n",
Expand All @@ -88,7 +88,7 @@
" \"\"\"\n",
" This is a debug function. You shouldn't concern yourself with\n",
" its implementation too much.\n",
" \n",
"\n",
" What it does is print out every intermediate step in applying a\n",
" simplifier (a function of the form (list, constraint) -> list)\n",
" along with whether it is a successful shrink or not.\n",
Expand Down Expand Up @@ -193,7 +193,7 @@
" s = list(ls)\n",
" del s[i]\n",
" yield list(s)\n",
" \n",
"\n",
" for i in range(len(ls)):\n",
" for x in range(ls[i]):\n",
" s = list(ls)\n",
Expand Down Expand Up @@ -1285,9 +1285,9 @@
"def shrink_integer(n):\n",
" \"\"\"\n",
" Shrinker for individual integers.\n",
" \n",
"\n",
" What happens is that we start from the left, first probing upwards in powers of two.\n",
" \n",
"\n",
" When this would take us past our target value we then binary chop towards it.\n",
" \"\"\"\n",
" if not n:\n",
Expand Down Expand Up @@ -1540,11 +1540,11 @@
" s = list(ls)\n",
" s[i] = x\n",
" yield s\n",
" \n",
"\n",
"def shrink4(ls):\n",
" yield from shrink_to_prefix(ls)\n",
" yield from delete_individual_elements(ls)\n",
" yield from shrink_individual_elements(ls) "
" yield from shrink_individual_elements(ls)"
]
},
{
Expand Down Expand Up @@ -1864,7 +1864,7 @@
" \"\"\"\n",
" Look for all sets of shared indices and try to perform a simultaneous shrink on\n",
" their value, replacing all of them at once.\n",
" \n",
"\n",
" In actual Hypothesis we also try replacing only subsets of the values when there\n",
" are more than two shared values, but we won't worry about that here.\n",
" \"\"\"\n",
Expand Down Expand Up @@ -2573,22 +2573,23 @@
" counts = []\n",
"\n",
" for ex in dataset:\n",
" counter = [0]\n",
" \n",
" counter = 0\n",
"\n",
" def run_and_count(ls):\n",
" counter[0] += 1\n",
" if counter[0] > MAX_COUNT:\n",
" raise MaximumCountExceeded()\n",
" nonlocal counter\n",
" counter += 1\n",
" if counter > MAX_COUNT:\n",
" raise MaximumCountExceeded\n",
" return constraint(ls)\n",
" \n",
"\n",
" try:\n",
" simplifier(ex, run_and_count)\n",
" counts.extend(counter)\n",
" counts.append(counter)\n",
" except MaximumCountExceeded:\n",
" counts.append(MAX_COUNT + 1)\n",
" break\n",
" return counts\n",
" \n",
"\n",
"def worst_case(condition, simplifier):\n",
" return max(call_counts(condition, simplifier))\n",
"\n",
Expand Down Expand Up @@ -2619,9 +2620,9 @@
" for h in header:\n",
" html_fragments.append(\"<th>%s</th>\" % (h,))\n",
" html_fragments.append(\"</tr>\\n</thead>\\n<tbody>\")\n",
" \n",
"\n",
" for name in conditions:\n",
" bits = [name.replace(\">\", \"&gt;\")] \n",
" bits = [name.replace(\">\", \"&gt;\")]\n",
" for _, simplifier in named_simplifiers:\n",
" value = worst_case(name, simplifier)\n",
" if value <= MAX_COUNT:\n",
Expand Down Expand Up @@ -4534,7 +4535,7 @@
" (\"Single pass\", partial(greedy_shrink_with_dedupe,\n",
" shrink=shrink6)),\n",
" (\"Multi pass\", multicourse_shrink3)\n",
" \n",
"\n",
"])"
]
},
Expand Down Expand Up @@ -4622,7 +4623,7 @@
" (\"Single pass\", partial(greedy_shrink_with_dedupe,\n",
" shrink=shrink6)),\n",
" (\"Multi pass\", multicourse_shrink3)\n",
" \n",
"\n",
"])"
]
},
Expand Down Expand Up @@ -4731,8 +4732,8 @@
" (\"Single pass\", partial(greedy_shrink_with_dedupe,\n",
" shrink=shrink6)),\n",
" (\"Multi pass\", multicourse_shrink3),\n",
" (\"Multi pass with restart\", multicourse_shrink4) \n",
" \n",
" (\"Multi pass with restart\", multicourse_shrink4)\n",
"\n",
"])"
]
},
Expand Down Expand Up @@ -4871,9 +4872,9 @@
"compare_simplifiers([\n",
" (\"Single pass\", partial(greedy_shrink_with_dedupe,\n",
" shrink=shrink6)),\n",
" (\"Multi pass\", multicourse_shrink3), \n",
" (\"Multi pass\", multicourse_shrink3),\n",
" (\"Multi pass with restart\", multicourse_shrink4),\n",
" (\"Multi pass with variable restart\", multicourse_shrink5) \n",
" (\"Multi pass with variable restart\", multicourse_shrink5)\n",
"])"
]
},
Expand Down
4 changes: 2 additions & 2 deletions requirements/coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fakeredis==2.23.5
# via -r requirements/coverage.in
iniconfig==2.0.0
# via pytest
lark==1.1.9
lark==1.2.2
# via -r requirements/coverage.in
libcst==1.4.0
# via -r requirements/coverage.in
Expand Down Expand Up @@ -76,7 +76,7 @@ pytz==2024.1
# via
# -r requirements/coverage.in
# pandas
pyyaml==6.0.1
pyyaml==6.0.2
# via libcst
redis==5.0.8
# via fakeredis
Expand Down
10 changes: 5 additions & 5 deletions requirements/fuzzing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ flask==3.0.3
# via dash
hypofuzz==24.2.3
# via -r requirements/fuzzing.in
hypothesis[cli]==6.108.9
hypothesis[cli]==6.111.1
# via hypofuzz
idna==3.7
# via requests
Expand All @@ -68,7 +68,7 @@ itsdangerous==2.2.0
# via flask
jinja2==3.1.4
# via flask
lark==1.1.9
lark==1.2.2
# via -r requirements/coverage.in
libcst==1.4.0
# via
Expand Down Expand Up @@ -136,7 +136,7 @@ pytz==2024.1
# via
# -r requirements/coverage.in
# pandas
pyyaml==6.0.1
pyyaml==6.0.2
# via libcst
redis==5.0.8
# via fakeredis
Expand Down Expand Up @@ -178,9 +178,9 @@ werkzeug==3.0.3
# via
# dash
# flask
zipp==3.19.2
zipp==3.20.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==72.1.0
setuptools==72.2.0
# via dash
30 changes: 15 additions & 15 deletions requirements/tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ attrs==24.1.0
# via hypothesis (hypothesis-python/setup.py)
autoflake==2.3.1
# via shed
babel==2.15.0
babel==2.16.0
# via sphinx
backports-tarfile==1.2.0
# via jaraco-context
Expand All @@ -32,7 +32,7 @@ cachetools==5.4.0
# via tox
certifi==2024.7.4
# via requests
cffi==1.16.0
cffi==1.17.0
# via cryptography
chardet==5.2.0
# via tox
Expand All @@ -59,7 +59,7 @@ decorator==5.1.1
# via ipython
distlib==0.3.8
# via virtualenv
django==5.0.7
django==5.1
# via -r requirements/tools.in
docutils==0.20.1
# via
Expand Down Expand Up @@ -121,13 +121,13 @@ jsonpointer==3.0.0
# via sphinx-jsonschema
keyring==25.3.0
# via twine
lark==1.1.9
lark==1.2.2
# via -r requirements/tools.in
libcst==1.4.0
# via
# -r requirements/tools.in
# shed
markdown==3.6
markdown==3.7
# via pelican
markdown-it-py==3.0.0
# via rich
Expand All @@ -137,7 +137,7 @@ matplotlib-inline==0.1.7
# via ipython
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.3.0
more-itertools==10.4.0
# via
# jaraco-classes
# jaraco-functools
Expand Down Expand Up @@ -207,7 +207,7 @@ pyproject-hooks==1.1.0
# via
# build
# pip-tools
pyright==1.1.374
pyright==1.1.376
# via -r requirements/tools.in
pytest==8.3.2
# via -r requirements/tools.in
Expand All @@ -219,7 +219,7 @@ pytz==2024.1
# via feedgenerator
pyupgrade==3.17.0
# via shed
pyyaml==6.0.1
pyyaml==6.0.2
# via
# libcst
# sphinx-jsonschema
Expand All @@ -242,7 +242,7 @@ rich==13.7.1
# via
# pelican
# twine
ruff==0.5.6
ruff==0.6.1
# via -r requirements/tools.in
secretstorage==3.3.3
# via keyring
Expand All @@ -258,7 +258,7 @@ snowballstemmer==2.2.0
# via sphinx
sortedcontainers==2.4.0
# via hypothesis (hypothesis-python/setup.py)
soupsieve==2.5
soupsieve==2.6
# via beautifulsoup4
sphinx==7.4.7
# via
Expand Down Expand Up @@ -310,7 +310,7 @@ tomli==2.0.1
# pytest
# sphinx
# tox
tox==4.17.0
tox==4.18.0
# via -r requirements/tools.in
traitlets==5.14.3
# via
Expand All @@ -328,7 +328,7 @@ types-pytz==2024.1.0.20240417
# via -r requirements/tools.in
types-redis==4.6.0.20240806
# via -r requirements/tools.in
types-setuptools==71.1.0.20240806
types-setuptools==71.1.0.20240813
# via types-cffi
typing-extensions==4.12.2
# via
Expand All @@ -346,17 +346,17 @@ urllib3==2.2.2
# twine
virtualenv==20.26.3
# via tox
watchfiles==0.22.0
watchfiles==0.23.0
# via pelican
wcwidth==0.2.13
# via prompt-toolkit
wheel==0.44.0
# via pip-tools
zipp==3.19.2
zipp==3.20.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
pip==24.2
# via pip-tools
setuptools==72.1.0
setuptools==72.2.0
# via pip-tools
2 changes: 1 addition & 1 deletion tooling/src/hypothesistooling/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def run_tox(task, version, *args):
"3.9": "3.9.19",
"3.10": "3.10.14",
"3.11": "3.11.9",
"3.12": "3.12.4",
"3.12": "3.12.5",
"3.13": "3.13.0rc1",
"3.13t": "3.13t-dev",
"3.14": "3.14-dev",
Expand Down

0 comments on commit c90732c

Please sign in to comment.