Skip to content

Commit 99f9627

Browse files
authored
Merge pull request #4136 from HypothesisWorks/create-pull-request/patch
Update pinned dependencies
2 parents 5f7ca9f + a373e61 commit 99f9627

File tree

12 files changed

+76
-57
lines changed

12 files changed

+76
-57
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 restores diversity to the outputs of
4+
:func:`from_type(type) <hypothesis.strategies.from_type>` (:issue:`4144`).

hypothesis-python/docs/conf.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import types
1515
from pathlib import Path
1616

17-
import sphinx_rtd_theme
18-
1917
root = Path(__file__).parent.parent
2018
sys.path.append(str(root / "src"))
2119

@@ -152,8 +150,6 @@ def setup(app):
152150

153151
html_theme = "sphinx_rtd_theme"
154152

155-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
156-
157153
html_static_path = ["_static"]
158154

159155
html_css_files = ["better-signatures.css", "wrap-in-tables.css"]

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,7 @@ def really_inner(thing):
822822
@register("Type")
823823
@register("Type", module=typing_extensions)
824824
def resolve_Type(thing):
825-
if getattr(thing, "__args__", None) is None:
826-
return st.just(type)
827-
elif get_args(thing) == (): # pragma: no cover
825+
if getattr(thing, "__args__", None) is None or get_args(thing) == ():
828826
return _fallback_type_strategy
829827
args = (thing.__args__[0],)
830828
if is_a_union(args[0]):

hypothesis-python/tests/nocover/test_from_type_recipe.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from hypothesis import given, strategies as st
1212
from hypothesis.strategies._internal.types import _global_type_lookup
1313

14+
from tests.common.debug import find_any
15+
1416
TYPES = sorted(
1517
(
1618
x
@@ -39,3 +41,7 @@ def everything_except(excluded_types):
3941
def test_recipe_for_everything_except(excluded_types, data):
4042
value = data.draw(everything_except(excluded_types))
4143
assert not isinstance(value, excluded_types)
44+
45+
46+
def test_issue_4144_regression():
47+
find_any(everything_except(()), lambda t: t is not type)

requirements/coverage.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ attrs==24.1.0
1212
# via
1313
# -r requirements/test.in
1414
# hypothesis (hypothesis-python/setup.py)
15-
black==24.8.0
15+
black==24.10.0
1616
# via -r requirements/coverage.in
1717
click==8.1.7
1818
# via
1919
# -r requirements/coverage.in
2020
# black
21-
coverage[toml]==7.6.1
21+
coverage[toml]==7.6.2
2222
# via pytest-cov
2323
dpcontracts==0.6.0
2424
# via -r requirements/coverage.in
@@ -34,7 +34,7 @@ iniconfig==2.0.0
3434
# via pytest
3535
lark==1.2.2
3636
# via -r requirements/coverage.in
37-
libcst==1.4.0
37+
libcst==1.5.0
3838
# via -r requirements/coverage.in
3939
mypy-extensions==1.0.0
4040
# via black

requirements/fuzzing.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ attrs==24.1.0
1313
# -r requirements/test.in
1414
# hypothesis
1515
# hypothesis (hypothesis-python/setup.py)
16-
black==24.8.0
16+
black==24.10.0
1717
# via
1818
# -r requirements/coverage.in
1919
# hypofuzz
@@ -22,15 +22,15 @@ blinker==1.8.2
2222
# via flask
2323
certifi==2024.8.30
2424
# via requests
25-
charset-normalizer==3.3.2
25+
charset-normalizer==3.4.0
2626
# via requests
2727
click==8.1.7
2828
# via
2929
# -r requirements/coverage.in
3030
# black
3131
# flask
3232
# hypothesis
33-
coverage[toml]==7.6.1
33+
coverage[toml]==7.6.2
3434
# via
3535
# hypofuzz
3636
# pytest-cov
@@ -57,7 +57,7 @@ flask==3.0.3
5757
# via dash
5858
hypofuzz==24.9.1
5959
# via -r requirements/fuzzing.in
60-
hypothesis[cli]==6.112.2
60+
hypothesis[cli]==6.115.0
6161
# via hypofuzz
6262
idna==3.10
6363
# via requests
@@ -71,13 +71,13 @@ jinja2==3.1.4
7171
# via flask
7272
lark==1.2.2
7373
# via -r requirements/coverage.in
74-
libcst==1.4.0
74+
libcst==1.5.0
7575
# via
7676
# -r requirements/coverage.in
7777
# hypofuzz
7878
markdown-it-py==3.0.0
7979
# via rich
80-
markupsafe==2.1.5
80+
markupsafe==3.0.1
8181
# via
8282
# jinja2
8383
# werkzeug

requirements/tools.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ numpy
1010
pelican[markdown]
1111
pip-tools
1212
pyright
13-
pytest
1413
python-dateutil
1514
requests
1615
restructuredtext-lint
@@ -28,3 +27,4 @@ types-click
2827
types-pytz
2928
types-redis
3029
typing-extensions
30+
-r test.in

requirements/tools.txt

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
#
55
# ./build.sh upgrade-requirements
66
#
7-
alabaster==0.7.16
7+
alabaster==1.0.0
88
# via sphinx
9-
anyio==4.6.0
9+
anyio==4.6.2.post1
1010
# via watchfiles
1111
asgiref==3.8.1
1212
# via django
1313
asttokens==2.4.1
1414
# via stack-data
15-
attrs==24.2.0
16-
# via hypothesis (hypothesis-python/setup.py)
15+
attrs==24.1.0
16+
# via
17+
# -r requirements/test.in
18+
# hypothesis (hypothesis-python/setup.py)
1719
autoflake==2.3.1
1820
# via shed
1921
babel==2.16.0
@@ -22,11 +24,11 @@ backports-tarfile==1.2.0
2224
# via jaraco-context
2325
beautifulsoup4==4.12.3
2426
# via sphinx-codeautolink
25-
black==24.8.0
27+
black==24.10.0
2628
# via shed
2729
blinker==1.8.2
2830
# via pelican
29-
build==1.2.2
31+
build==1.2.2.post1
3032
# via pip-tools
3133
cachetools==5.5.0
3234
# via tox
@@ -36,7 +38,7 @@ cffi==1.17.1
3638
# via cryptography
3739
chardet==5.2.0
3840
# via tox
39-
charset-normalizer==3.3.2
41+
charset-normalizer==3.4.0
4042
# via requests
4143
click==8.1.7
4244
# via
@@ -48,7 +50,7 @@ colorama==0.4.6
4850
# via tox
4951
com2ann==0.3.0
5052
# via shed
51-
coverage==7.6.1
53+
coverage==7.6.3
5254
# via -r requirements/tools.in
5355
cryptography==43.0.1
5456
# via
@@ -57,11 +59,11 @@ cryptography==43.0.1
5759
# types-redis
5860
decorator==5.1.1
5961
# via ipython
60-
distlib==0.3.8
62+
distlib==0.3.9
6163
# via virtualenv
62-
django==5.1.1
64+
django==5.1.2
6365
# via -r requirements/tools.in
64-
docutils==0.20.1
66+
docutils==0.21.2
6567
# via
6668
# pelican
6769
# readme-renderer
@@ -77,6 +79,8 @@ exceptiongroup==1.2.2 ; python_version < "3.11"
7779
# hypothesis (hypothesis-python/setup.py)
7880
# ipython
7981
# pytest
82+
execnet==2.1.1
83+
# via pytest-xdist
8084
executing==2.1.0
8185
# via stack-data
8286
feedgenerator==2.1.0
@@ -123,15 +127,15 @@ keyring==25.4.1
123127
# via twine
124128
lark==1.2.2
125129
# via -r requirements/tools.in
126-
libcst==1.4.0
130+
libcst==1.5.0
127131
# via
128132
# -r requirements/tools.in
129133
# shed
130134
markdown==3.7
131135
# via pelican
132136
markdown-it-py==3.0.0
133137
# via rich
134-
markupsafe==2.1.5
138+
markupsafe==3.0.1
135139
# via jinja2
136140
matplotlib-inline==0.1.7
137141
# via ipython
@@ -170,7 +174,9 @@ pathspec==0.12.1
170174
pelican[markdown]==4.10.1
171175
# via -r requirements/tools.in
172176
pexpect==4.9.0
173-
# via ipython
177+
# via
178+
# -r requirements/test.in
179+
# ipython
174180
pip-tools==7.4.1
175181
# via -r requirements/tools.in
176182
pkginfo==1.10.0
@@ -207,23 +213,27 @@ pyproject-hooks==1.2.0
207213
# via
208214
# build
209215
# pip-tools
210-
pyright==1.1.383
216+
pyright==1.1.384
211217
# via -r requirements/tools.in
212218
pytest==8.3.3
213-
# via -r requirements/tools.in
219+
# via
220+
# -r requirements/test.in
221+
# pytest-xdist
222+
pytest-xdist==3.6.1
223+
# via -r requirements/test.in
214224
python-dateutil==2.9.0.post0
215225
# via
216226
# -r requirements/tools.in
217227
# pelican
218228
pytz==2024.2
219229
# via feedgenerator
220-
pyupgrade==3.17.0
230+
pyupgrade==3.18.0
221231
# via shed
222232
pyyaml==6.0.2
223233
# via
224234
# libcst
225235
# sphinx-jsonschema
226-
readme-renderer==43.0
236+
readme-renderer==44.0
227237
# via twine
228238
requests==2.32.3
229239
# via
@@ -260,7 +270,7 @@ sortedcontainers==2.4.0
260270
# via hypothesis (hypothesis-python/setup.py)
261271
soupsieve==2.6
262272
# via beautifulsoup4
263-
sphinx==7.4.7
273+
sphinx==8.1.3
264274
# via
265275
# -r requirements/tools.in
266276
# sphinx-codeautolink
@@ -273,7 +283,7 @@ sphinx-hoverxref==1.4.1
273283
# via -r requirements/tools.in
274284
sphinx-jsonschema==1.19.1
275285
# via -r requirements/tools.in
276-
sphinx-rtd-theme==2.0.0
286+
sphinx-rtd-theme==3.0.1
277287
# via -r requirements/tools.in
278288
sphinx-selective-exclude==1.0.3
279289
# via -r requirements/tools.in
@@ -328,7 +338,7 @@ types-pytz==2024.2.0.20241003
328338
# via -r requirements/tools.in
329339
types-redis==4.6.0.20241004
330340
# via -r requirements/tools.in
331-
types-setuptools==75.1.0.20240917
341+
types-setuptools==75.1.0.20241014
332342
# via types-cffi
333343
typing-extensions==4.12.2
334344
# via

tooling/src/hypothesistooling/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def check_whole_repo_tests(*args):
548548
)
549549

550550
if not args:
551-
args = [tools.REPO_TESTS]
551+
args = ["-n", "auto", tools.REPO_TESTS]
552552
subprocess.check_call([sys.executable, "-m", "pytest", *args])
553553

554554

whole_repo_tests/revealed_types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
99
# obtain one at https://mozilla.org/MPL/2.0/.
1010

11+
import re
12+
13+
from hypothesistooling.__main__ import PYTHONS as pythons_map
14+
15+
PYTHON_VERSIONS = [v for v in pythons_map if re.fullmatch(r"3\.\d\d?", v)]
16+
1117
try:
1218
from numpy import __version__ as np_version
1319
except ImportError:

whole_repo_tests/test_mypy.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
from hypothesistooling.projects.hypothesispython import PYTHON_SRC
1717
from hypothesistooling.scripts import pip_tool, tool_path
1818

19-
from .revealed_types import NUMPY_REVEALED_TYPES, REVEALED_TYPES
20-
21-
PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
19+
from .revealed_types import NUMPY_REVEALED_TYPES, PYTHON_VERSIONS, REVEALED_TYPES
2220

2321

2422
def test_mypy_passes_on_hypothesis():
@@ -262,7 +260,8 @@ def test_stateful_bundle_generic_type(tmp_path):
262260
f.write_text(
263261
"from hypothesis.stateful import Bundle\n"
264262
"b: Bundle[int] = Bundle('test')\n"
265-
"reveal_type(b.example())\n",
263+
"x = b.example()\n"
264+
"reveal_type(x)\n",
266265
encoding="utf-8",
267266
)
268267
got = get_mypy_analysed_type(f)
@@ -328,7 +327,8 @@ def test_stateful_target_params_mutually_exclusive(tmp_path, decorator):
328327
"target_args",
329328
[
330329
"target=b1",
331-
"targets=(b1,)",
330+
# FIXME: temporary workaround for mypy bug, see hypothesis/pull/4136
331+
pytest.param("targets=(b1,)", marks=pytest.mark.xfail(strict=False)),
332332
"targets=(b1, b2)",
333333
"",
334334
],

0 commit comments

Comments
 (0)