Skip to content

Commit

Permalink
Merge pull request #4136 from HypothesisWorks/create-pull-request/patch
Browse files Browse the repository at this point in the history
Update pinned dependencies
  • Loading branch information
Zac-HD authored Oct 23, 2024
2 parents 5f7ca9f + a373e61 commit 99f9627
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 57 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 restores diversity to the outputs of
:func:`from_type(type) <hypothesis.strategies.from_type>` (:issue:`4144`).
4 changes: 0 additions & 4 deletions hypothesis-python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import types
from pathlib import Path

import sphinx_rtd_theme

root = Path(__file__).parent.parent
sys.path.append(str(root / "src"))

Expand Down Expand Up @@ -152,8 +150,6 @@ def setup(app):

html_theme = "sphinx_rtd_theme"

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

html_static_path = ["_static"]

html_css_files = ["better-signatures.css", "wrap-in-tables.css"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,7 @@ def really_inner(thing):
@register("Type")
@register("Type", module=typing_extensions)
def resolve_Type(thing):
if getattr(thing, "__args__", None) is None:
return st.just(type)
elif get_args(thing) == (): # pragma: no cover
if getattr(thing, "__args__", None) is None or get_args(thing) == ():
return _fallback_type_strategy
args = (thing.__args__[0],)
if is_a_union(args[0]):
Expand Down
6 changes: 6 additions & 0 deletions hypothesis-python/tests/nocover/test_from_type_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from hypothesis import given, strategies as st
from hypothesis.strategies._internal.types import _global_type_lookup

from tests.common.debug import find_any

TYPES = sorted(
(
x
Expand Down Expand Up @@ -39,3 +41,7 @@ def everything_except(excluded_types):
def test_recipe_for_everything_except(excluded_types, data):
value = data.draw(everything_except(excluded_types))
assert not isinstance(value, excluded_types)


def test_issue_4144_regression():
find_any(everything_except(()), lambda t: t is not type)
6 changes: 3 additions & 3 deletions requirements/coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ attrs==24.1.0
# via
# -r requirements/test.in
# hypothesis (hypothesis-python/setup.py)
black==24.8.0
black==24.10.0
# via -r requirements/coverage.in
click==8.1.7
# via
# -r requirements/coverage.in
# black
coverage[toml]==7.6.1
coverage[toml]==7.6.2
# via pytest-cov
dpcontracts==0.6.0
# via -r requirements/coverage.in
Expand All @@ -34,7 +34,7 @@ iniconfig==2.0.0
# via pytest
lark==1.2.2
# via -r requirements/coverage.in
libcst==1.4.0
libcst==1.5.0
# via -r requirements/coverage.in
mypy-extensions==1.0.0
# via black
Expand Down
12 changes: 6 additions & 6 deletions requirements/fuzzing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ attrs==24.1.0
# -r requirements/test.in
# hypothesis
# hypothesis (hypothesis-python/setup.py)
black==24.8.0
black==24.10.0
# via
# -r requirements/coverage.in
# hypofuzz
Expand All @@ -22,15 +22,15 @@ blinker==1.8.2
# via flask
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
charset-normalizer==3.4.0
# via requests
click==8.1.7
# via
# -r requirements/coverage.in
# black
# flask
# hypothesis
coverage[toml]==7.6.1
coverage[toml]==7.6.2
# via
# hypofuzz
# pytest-cov
Expand All @@ -57,7 +57,7 @@ flask==3.0.3
# via dash
hypofuzz==24.9.1
# via -r requirements/fuzzing.in
hypothesis[cli]==6.112.2
hypothesis[cli]==6.115.0
# via hypofuzz
idna==3.10
# via requests
Expand All @@ -71,13 +71,13 @@ jinja2==3.1.4
# via flask
lark==1.2.2
# via -r requirements/coverage.in
libcst==1.4.0
libcst==1.5.0
# via
# -r requirements/coverage.in
# hypofuzz
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
markupsafe==3.0.1
# via
# jinja2
# werkzeug
Expand Down
2 changes: 1 addition & 1 deletion requirements/tools.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ numpy
pelican[markdown]
pip-tools
pyright
pytest
python-dateutil
requests
restructuredtext-lint
Expand All @@ -28,3 +27,4 @@ types-click
types-pytz
types-redis
typing-extensions
-r test.in
52 changes: 31 additions & 21 deletions requirements/tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
#
# ./build.sh upgrade-requirements
#
alabaster==0.7.16
alabaster==1.0.0
# via sphinx
anyio==4.6.0
anyio==4.6.2.post1
# via watchfiles
asgiref==3.8.1
# via django
asttokens==2.4.1
# via stack-data
attrs==24.2.0
# via hypothesis (hypothesis-python/setup.py)
attrs==24.1.0
# via
# -r requirements/test.in
# hypothesis (hypothesis-python/setup.py)
autoflake==2.3.1
# via shed
babel==2.16.0
Expand All @@ -22,11 +24,11 @@ backports-tarfile==1.2.0
# via jaraco-context
beautifulsoup4==4.12.3
# via sphinx-codeautolink
black==24.8.0
black==24.10.0
# via shed
blinker==1.8.2
# via pelican
build==1.2.2
build==1.2.2.post1
# via pip-tools
cachetools==5.5.0
# via tox
Expand All @@ -36,7 +38,7 @@ cffi==1.17.1
# via cryptography
chardet==5.2.0
# via tox
charset-normalizer==3.3.2
charset-normalizer==3.4.0
# via requests
click==8.1.7
# via
Expand All @@ -48,7 +50,7 @@ colorama==0.4.6
# via tox
com2ann==0.3.0
# via shed
coverage==7.6.1
coverage==7.6.3
# via -r requirements/tools.in
cryptography==43.0.1
# via
Expand All @@ -57,11 +59,11 @@ cryptography==43.0.1
# types-redis
decorator==5.1.1
# via ipython
distlib==0.3.8
distlib==0.3.9
# via virtualenv
django==5.1.1
django==5.1.2
# via -r requirements/tools.in
docutils==0.20.1
docutils==0.21.2
# via
# pelican
# readme-renderer
Expand All @@ -77,6 +79,8 @@ exceptiongroup==1.2.2 ; python_version < "3.11"
# hypothesis (hypothesis-python/setup.py)
# ipython
# pytest
execnet==2.1.1
# via pytest-xdist
executing==2.1.0
# via stack-data
feedgenerator==2.1.0
Expand Down Expand Up @@ -123,15 +127,15 @@ keyring==25.4.1
# via twine
lark==1.2.2
# via -r requirements/tools.in
libcst==1.4.0
libcst==1.5.0
# via
# -r requirements/tools.in
# shed
markdown==3.7
# via pelican
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
markupsafe==3.0.1
# via jinja2
matplotlib-inline==0.1.7
# via ipython
Expand Down Expand Up @@ -170,7 +174,9 @@ pathspec==0.12.1
pelican[markdown]==4.10.1
# via -r requirements/tools.in
pexpect==4.9.0
# via ipython
# via
# -r requirements/test.in
# ipython
pip-tools==7.4.1
# via -r requirements/tools.in
pkginfo==1.10.0
Expand Down Expand Up @@ -207,23 +213,27 @@ pyproject-hooks==1.2.0
# via
# build
# pip-tools
pyright==1.1.383
pyright==1.1.384
# via -r requirements/tools.in
pytest==8.3.3
# via -r requirements/tools.in
# via
# -r requirements/test.in
# pytest-xdist
pytest-xdist==3.6.1
# via -r requirements/test.in
python-dateutil==2.9.0.post0
# via
# -r requirements/tools.in
# pelican
pytz==2024.2
# via feedgenerator
pyupgrade==3.17.0
pyupgrade==3.18.0
# via shed
pyyaml==6.0.2
# via
# libcst
# sphinx-jsonschema
readme-renderer==43.0
readme-renderer==44.0
# via twine
requests==2.32.3
# via
Expand Down Expand Up @@ -260,7 +270,7 @@ sortedcontainers==2.4.0
# via hypothesis (hypothesis-python/setup.py)
soupsieve==2.6
# via beautifulsoup4
sphinx==7.4.7
sphinx==8.1.3
# via
# -r requirements/tools.in
# sphinx-codeautolink
Expand All @@ -273,7 +283,7 @@ sphinx-hoverxref==1.4.1
# via -r requirements/tools.in
sphinx-jsonschema==1.19.1
# via -r requirements/tools.in
sphinx-rtd-theme==2.0.0
sphinx-rtd-theme==3.0.1
# via -r requirements/tools.in
sphinx-selective-exclude==1.0.3
# via -r requirements/tools.in
Expand Down Expand Up @@ -328,7 +338,7 @@ types-pytz==2024.2.0.20241003
# via -r requirements/tools.in
types-redis==4.6.0.20241004
# via -r requirements/tools.in
types-setuptools==75.1.0.20240917
types-setuptools==75.1.0.20241014
# via types-cffi
typing-extensions==4.12.2
# via
Expand Down
2 changes: 1 addition & 1 deletion tooling/src/hypothesistooling/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def check_whole_repo_tests(*args):
)

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


Expand Down
6 changes: 6 additions & 0 deletions whole_repo_tests/revealed_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
# 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 re

from hypothesistooling.__main__ import PYTHONS as pythons_map

PYTHON_VERSIONS = [v for v in pythons_map if re.fullmatch(r"3\.\d\d?", v)]

try:
from numpy import __version__ as np_version
except ImportError:
Expand Down
10 changes: 5 additions & 5 deletions whole_repo_tests/test_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
from hypothesistooling.projects.hypothesispython import PYTHON_SRC
from hypothesistooling.scripts import pip_tool, tool_path

from .revealed_types import NUMPY_REVEALED_TYPES, REVEALED_TYPES

PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
from .revealed_types import NUMPY_REVEALED_TYPES, PYTHON_VERSIONS, REVEALED_TYPES


def test_mypy_passes_on_hypothesis():
Expand Down Expand Up @@ -262,7 +260,8 @@ def test_stateful_bundle_generic_type(tmp_path):
f.write_text(
"from hypothesis.stateful import Bundle\n"
"b: Bundle[int] = Bundle('test')\n"
"reveal_type(b.example())\n",
"x = b.example()\n"
"reveal_type(x)\n",
encoding="utf-8",
)
got = get_mypy_analysed_type(f)
Expand Down Expand Up @@ -328,7 +327,8 @@ def test_stateful_target_params_mutually_exclusive(tmp_path, decorator):
"target_args",
[
"target=b1",
"targets=(b1,)",
# FIXME: temporary workaround for mypy bug, see hypothesis/pull/4136
pytest.param("targets=(b1,)", marks=pytest.mark.xfail(strict=False)),
"targets=(b1, b2)",
"",
],
Expand Down
Loading

0 comments on commit 99f9627

Please sign in to comment.