Skip to content

Commit

Permalink
Merge pull request #4178 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 Nov 29, 2024
2 parents 3e1767f + a6e697d commit 58145cb
Show file tree
Hide file tree
Showing 24 changed files with 91 additions and 84 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,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.26.3
PYODIDE_VERSION: 0.26.4
PYTHON_VERSION: 3.12.1
EMSCRIPTEN_VERSION: 3.1.58
steps:
Expand All @@ -245,7 +245,6 @@ jobs:
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache
- name: Build
run: |
pip install pyodide-build==$PYODIDE_VERSION
Expand Down
3 changes: 3 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RELEASE_TYPE: patch

This patch updates our autoformatting tools, improving our code style without any API changes.
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.18", "crosshair-tool>=0.0.77"],
"crosshair": ["hypothesis-crosshair>=0.0.18", "crosshair-tool>=0.0.78"],
# zoneinfo is an odd one: every dependency is platform-conditional.
"zoneinfo": [
"tzdata>=2024.2 ; sys_platform == 'win32' or sys_platform == 'emscripten'",
Expand Down
4 changes: 2 additions & 2 deletions hypothesis-python/src/hypothesis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"HealthCheck",
"Phase",
"Verbosity",
"__version__",
"__version_info__",
"assume",
"currently_in_test_context",
"event",
Expand All @@ -50,8 +52,6 @@
"seed",
"settings",
"target",
"__version__",
"__version_info__",
]

run()
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
__all__ = [
"DirectoryBasedExampleDatabase",
"ExampleDatabase",
"GitHubArtifactDatabase",
"InMemoryExampleDatabase",
"MultiplexedDatabase",
"ReadOnlyDatabase",
"GitHubArtifactDatabase",
]


Expand Down
16 changes: 8 additions & 8 deletions hypothesis-python/src/hypothesis/extra/_array_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@

__all__ = [
"NDIM_MAX",
"Shape",
"BroadcastableShapes",
"BasicIndex",
"check_argument",
"order_check",
"check_valid_dims",
"BasicIndexStrategy",
"BroadcastableShapes",
"MutuallyBroadcastableShapesStrategy",
"Shape",
"array_shapes",
"valid_tuple_axes",
"broadcastable_shapes",
"check_argument",
"check_valid_dims",
"mutually_broadcastable_shapes",
"MutuallyBroadcastableShapesStrategy",
"BasicIndexStrategy",
"order_check",
"valid_tuple_axes",
]


Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/extra/django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"TestCase",
"TransactionTestCase",
"from_field",
"from_form",
"from_model",
"register_field_strategy",
"from_form",
]
26 changes: 13 additions & 13 deletions hypothesis-python/src/hypothesis/extra/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,26 @@ def _try_import(mod_name: str, attr_name: str) -> Any:

__all__ = [
"BroadcastableShapes",
"from_dtype",
"arrays",
"array_dtypes",
"array_shapes",
"scalar_dtypes",
"arrays",
"basic_indices",
"boolean_dtypes",
"unsigned_integer_dtypes",
"integer_dtypes",
"floating_dtypes",
"broadcastable_shapes",
"byte_string_dtypes",
"complex_number_dtypes",
"datetime64_dtypes",
"floating_dtypes",
"from_dtype",
"integer_array_indices",
"integer_dtypes",
"mutually_broadcastable_shapes",
"nested_dtypes",
"scalar_dtypes",
"timedelta64_dtypes",
"byte_string_dtypes",
"unicode_string_dtypes",
"array_dtypes",
"nested_dtypes",
"unsigned_integer_dtypes",
"valid_tuple_axes",
"broadcastable_shapes",
"mutually_broadcastable_shapes",
"basic_indices",
"integer_array_indices",
]

TIME_RESOLUTIONS = tuple("Y M D h m s ms us ns ps fs as".split())
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/extra/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
series,
)

__all__ = ["indexes", "range_indexes", "series", "column", "columns", "data_frames"]
__all__ = ["column", "columns", "data_frames", "indexes", "range_indexes", "series"]
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/internal/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class GenericCache:
on_access and on_evict to implement a specific scoring strategy.
"""

__slots__ = ("max_size", "_threadlocal")
__slots__ = ("_threadlocal", "max_size")

def __init__(self, max_size):
if max_size <= 0:
Expand Down
4 changes: 2 additions & 2 deletions hypothesis-python/src/hypothesis/internal/conjecture/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class Example:
often dramatically reduce our memory usage, so is worth it.
"""

__slots__ = ("owner", "index")
__slots__ = ("index", "owner")

def __init__(self, owner: "Examples", index: int) -> None:
self.owner = owner
Expand Down Expand Up @@ -713,7 +713,7 @@ class Blocks:
be preferred to using the Block objects directly, as it will not
have to allocate the actual object."""

__slots__ = ("endpoints", "owner", "__blocks", "__count", "__sparse")
__slots__ = ("__blocks", "__count", "__sparse", "endpoints", "owner")
owner: "Union[ConjectureData, ConjectureResult, None]"
__blocks: Union[dict[int, Block], list[Optional[Block]]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
from hypothesis.internal.conjecture.shrinking.ordering import Ordering
from hypothesis.internal.conjecture.shrinking.string import String

__all__ = ["Integer", "Ordering", "Float", "Collection", "String", "Bytes"]
__all__ = ["Bytes", "Collection", "Float", "Integer", "Ordering", "String"]
6 changes: 4 additions & 2 deletions hypothesis-python/src/hypothesis/internal/escalation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ def get_trimmed_traceback(exception=None):
tb is None
or os.environ.get("HYPOTHESIS_NO_TRACEBACK_TRIM", None)
or hypothesis.settings.default.verbosity >= hypothesis.Verbosity.debug
or is_hypothesis_file(traceback.extract_tb(tb)[-1][0])
and not isinstance(exception, _Trimmable)
or (
is_hypothesis_file(traceback.extract_tb(tb)[-1][0])
and not isinstance(exception, _Trimmable)
)
):
return tb
while tb.tb_next is not None and (
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/internal/scrutineer.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def should_trace_file(fname: str) -> bool:
class Tracer:
"""A super-simple branch coverage tracer."""

__slots__ = ("branches", "_previous_location", "_should_trace")
__slots__ = ("_previous_location", "_should_trace", "branches")

def __init__(self, *, should_trace: bool) -> None:
self.branches: Trace = set()
Expand Down
6 changes: 3 additions & 3 deletions hypothesis-python/src/hypothesis/strategies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,21 @@


__all__ = [
"DataObject",
"DrawFn",
"SearchStrategy",
"binary",
"booleans",
"builds",
"characters",
"complex_numbers",
"composite",
"data",
"DataObject",
"dates",
"datetimes",
"decimals",
"deferred",
"dictionaries",
"DrawFn",
"emails",
"fixed_dictionaries",
"floats",
Expand Down Expand Up @@ -112,7 +113,6 @@
"timezones",
"tuples",
"uuids",
"SearchStrategy",
]


Expand Down
22 changes: 12 additions & 10 deletions hypothesis-python/src/hypothesis/strategies/_internal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,16 @@ def lists(
and len(unique_by) == 1
and (
# Introspection for either `itemgetter(0)`, or `lambda x: x[0]`
isinstance(unique_by[0], operator.itemgetter)
and repr(unique_by[0]) == "operator.itemgetter(0)"
or isinstance(unique_by[0], FunctionType)
and re.fullmatch(
get_pretty_function_description(unique_by[0]),
r"lambda ([a-z]+): \1\[0\]",
(
isinstance(unique_by[0], operator.itemgetter)
and repr(unique_by[0]) == "operator.itemgetter(0)"
)
or (
isinstance(unique_by[0], FunctionType)
and re.fullmatch(
get_pretty_function_description(unique_by[0]),
r"lambda ([a-z]+): \1\[0\]",
)
)
)
):
Expand Down Expand Up @@ -1299,10 +1303,8 @@ def from_type_guarded(thing):
# We've kept it because we turn out to have more type errors from... somewhere.
# FIXME: investigate that, maybe it should be fixed more precisely?
pass
if (
hasattr(typing, "_TypedDictMeta")
and type(thing) is typing._TypedDictMeta
or hasattr(types.typing_extensions, "_TypedDictMeta") # type: ignore
if (hasattr(typing, "_TypedDictMeta") and type(thing) is typing._TypedDictMeta) or (
hasattr(types.typing_extensions, "_TypedDictMeta") # type: ignore
and type(thing) is types.typing_extensions._TypedDictMeta # type: ignore
): # pragma: no cover

Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/vendor/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def _repr_pretty_(self, p, cycle):
from math import copysign, isnan

__all__ = [
"pretty",
"IDKey",
"RepresentationPrinter",
"pretty",
]


Expand Down
4 changes: 2 additions & 2 deletions hypothesis-python/tests/array_api/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

__all__ = [
"MIN_VER_FOR_COMPLEX",
"installed_array_modules",
"flushes_to_zero",
"dtype_name_params",
"flushes_to_zero",
"installed_array_modules",
]


Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/tests/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

from tests.common.debug import TIME_INCREMENT

__all__ = ["standard_types", "OrderedPair", "TIME_INCREMENT"]
__all__ = ["TIME_INCREMENT", "OrderedPair", "standard_types"]

OrderedPair = namedtuple("OrderedPair", ("left", "right"))

Expand Down
8 changes: 4 additions & 4 deletions requirements/coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ click==8.1.7
# via
# -r requirements/coverage.in
# black
coverage[toml]==7.6.4
coverage[toml]==7.6.8
# 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.5.0
libcst==1.5.1
# via -r requirements/coverage.in
mypy-extensions==1.0.0
# via black
Expand All @@ -58,7 +58,7 @@ pluggy==1.5.0
# via pytest
ptyprocess==0.7.0
# via pexpect
pyarrow==18.0.0
pyarrow==18.1.0
# via -r requirements/coverage.in
pytest==8.3.3
# via
Expand Down Expand Up @@ -87,7 +87,7 @@ sortedcontainers==2.4.0
# via
# fakeredis
# hypothesis (hypothesis-python/setup.py)
tomli==2.0.2
tomli==2.2.1
# via
# black
# coverage
Expand Down
14 changes: 7 additions & 7 deletions requirements/fuzzing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ click==8.1.7
# black
# flask
# hypothesis
coverage[toml]==7.6.4
coverage[toml]==7.6.8
# 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.118.6
hypothesis[cli]==6.121.1
# via hypofuzz
idna==3.10
# via requests
Expand All @@ -71,7 +71,7 @@ jinja2==3.1.4
# via flask
lark==1.2.2
# via -r requirements/coverage.in
libcst==1.5.0
libcst==1.5.1
# via
# -r requirements/coverage.in
# hypofuzz
Expand Down Expand Up @@ -114,7 +114,7 @@ psutil==6.1.0
# via hypofuzz
ptyprocess==0.7.0
# via pexpect
pyarrow==18.0.0
pyarrow==18.1.0
# via -r requirements/coverage.in
pygments==2.18.0
# via rich
Expand Down Expand Up @@ -159,7 +159,7 @@ sortedcontainers==2.4.0
# hypothesis (hypothesis-python/setup.py)
tenacity==9.0.0
# via plotly
tomli==2.0.2
tomli==2.2.1
# via
# black
# coverage
Expand All @@ -179,9 +179,9 @@ werkzeug==3.0.6
# via
# dash
# flask
zipp==3.20.2
zipp==3.21.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==75.3.0
setuptools==75.6.0
# via dash
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ pytest-xdist==3.6.1
# via -r requirements/test.in
sortedcontainers==2.4.0
# via hypothesis (hypothesis-python/setup.py)
tomli==2.0.2
tomli==2.2.1
# via pytest
Loading

0 comments on commit 58145cb

Please sign in to comment.