Skip to content

Commit 729ad70

Browse files
committed
some fixes?
1 parent ac86f41 commit 729ad70

File tree

11 files changed

+36
-19
lines changed

11 files changed

+36
-19
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
# Note that the versions below are updated by `update_pyodide_versions()` in our weekly cronjob.
253253
# The versions of pyodide-build and the Pyodide runtime may differ.
254254
PYODIDE_VERSION: 0.29.0
255-
PYODIDE_BUILD_VERSION: 0.30.9
255+
PYODIDE_BUILD_VERSION: 0.31.1
256256
PYTHON_VERSION: 3.13.2
257257
steps:
258258
- uses: actions/checkout@v3

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fi
3434
TOOL_REQUIREMENTS="$ROOT/requirements/tools.txt"
3535

3636
# append PYTHON_VERSION to bust caches when we upgrade versions
37-
TOOL_HASH=$((cat "$TOOL_REQUIREMENTS" && echo "$PYTHON_VERSION") | "$PYTHON" "$SCRIPTS/tool-hash.py")
37+
TOOL_HASH=$( (cat "$TOOL_REQUIREMENTS" && echo "$PYTHON_VERSION") | "$PYTHON" "$SCRIPTS/tool-hash.py")
3838

3939
TOOL_VIRTUALENV="$VIRTUALENVS/build-$TOOL_HASH"
4040
TOOL_PYTHON="$TOOL_VIRTUALENV/bin/python"

hypothesis-python/RELEASE.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
RELEASE_TYPE: patch
22

3-
Removes some internal ``# type: ignore`` comments as a result of bumping CI packages.
3+
Update some internal type hints.

hypothesis-python/src/hypothesis/database.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,26 @@ def __call__(self, *args: Any, **kwargs: Any) -> "ExampleDatabase":
134134
# downstream ExampleDatabase subclasses too.
135135
if "sphinx" in sys.modules:
136136
try:
137+
from types import ModuleType
138+
137139
import sphinx.ext.autodoc
138140

139141
signature = "hypothesis.database._EDMeta.__call__"
142+
_module: ModuleType # make mypy happy
143+
144+
# _METACLASS_CALL_BLACKLIST moved in newer sphinx versions
145+
try:
146+
import sphinx.ext.autodoc._dynamic._signatures as _module
147+
except ImportError:
148+
_module = sphinx.ext.autodoc
149+
140150
# _METACLASS_CALL_BLACKLIST is a frozenset in later sphinx versions
141-
if isinstance(sphinx.ext.autodoc._METACLASS_CALL_BLACKLIST, frozenset):
142-
sphinx.ext.autodoc._METACLASS_CALL_BLACKLIST = (
143-
sphinx.ext.autodoc._METACLASS_CALL_BLACKLIST | {signature}
151+
if isinstance(_module._METACLASS_CALL_BLACKLIST, frozenset):
152+
_module._METACLASS_CALL_BLACKLIST = ( # type: ignore
153+
_module._METACLASS_CALL_BLACKLIST | {signature}
144154
)
145155
else:
146-
sphinx.ext.autodoc._METACLASS_CALL_BLACKLIST.append(signature)
156+
_module._METACLASS_CALL_BLACKLIST.append(signature)
147157
except Exception:
148158
pass
149159

hypothesis-python/src/hypothesis/internal/compat.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
get_args,
2828
)
2929

30-
try:
31-
BaseExceptionGroup = BaseExceptionGroup
32-
ExceptionGroup = ExceptionGroup # pragma: no cover
33-
except NameError:
30+
if sys.version_info >= (3, 11):
31+
BaseExceptionGroup = BaseExceptionGroup # noqa: F821
32+
ExceptionGroup = ExceptionGroup # noqa: F821
33+
else:
3434
from exceptiongroup import (
3535
BaseExceptionGroup as BaseExceptionGroup,
3636
ExceptionGroup as ExceptionGroup,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,6 +2499,7 @@ def register_type_strategy(
24992499
)
25002500
if (
25012501
"pydantic.generics" in sys.modules
2502+
and isinstance(custom_type, type)
25022503
and issubclass(custom_type, sys.modules["pydantic.generics"].GenericModel)
25032504
and not re.search(r"[A-Za-z_]+\[.+\]", repr(custom_type))
25042505
and callable(strategy)

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,13 @@ def _networks(bits):
717717
# exposed for it, and NotImplemented itself is typed as Any so that it can be
718718
# returned without being listed in a function signature:
719719
# https://github.com/python/mypy/issues/6710#issuecomment-485580032
720+
if sys.version_info < (3, 12):
721+
_RegistryKeyT: typing.TypeAlias = type
722+
else: # pragma: no cover
723+
_RegistryKeyT: typing.TypeAlias = type | typing.TypeAliasType
724+
720725
_global_type_lookup: dict[
721-
type, st.SearchStrategy | typing.Callable[[type], st.SearchStrategy]
726+
_RegistryKeyT, st.SearchStrategy | typing.Callable[[type], st.SearchStrategy]
722727
] = {
723728
type(None): st.none(),
724729
bool: st.booleans(),

hypothesis-python/tests/conjecture/test_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,8 @@ def test_provider_conformance(provider):
795795
# emitted by available_timezones() from st.timezone_keys() on 3.11+
796796
# with tzdata installed. see https://github.com/python/cpython/issues/137841.
797797
# Once cpython fixes this, we can remove this.
798-
if sys.version_info >= (3, 10):
799-
warnings.simplefilter("ignore", EncodingWarning) # noqa: F821
798+
if sys.version_info >= (3, 11):
799+
warnings.simplefilter("ignore", EncodingWarning)
800800
run_conformance_test(
801801
provider, settings=settings(max_examples=20, stateful_step_count=20)
802802
)

requirements/tools.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ typing-extensions
2929
watchdog # for typing
3030
build
3131
sortedcontainers-stubs # for typing
32+
attrs # for typing
3233
tomli # for update_pyproject_toml
3334
-r test.in

requirements/tools.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ asgiref==3.11.0
1414
# via django
1515
asttokens==3.0.1
1616
# via stack-data
17+
attrs==25.4.0
18+
# via -r requirements/tools.in
1719
autoflake==2.3.1
1820
# via shed
1921
babel==2.17.0
@@ -60,7 +62,7 @@ decorator==5.2.1
6062
# via ipython
6163
distlib==0.4.0
6264
# via virtualenv
63-
django==6.0.1
65+
django==5.2.10
6466
# via -r requirements/tools.in
6567
docutils==0.22.4
6668
# via
@@ -268,7 +270,7 @@ sortedcontainers-stubs==2.4.3
268270
# via -r requirements/tools.in
269271
soupsieve==2.8.1
270272
# via beautifulsoup4
271-
sphinx==9.1.0
273+
sphinx==9.0.4
272274
# via
273275
# -r requirements/tools.in
274276
# furo

0 commit comments

Comments
 (0)