From 41029d28de1e0f1157ed6f5c27a2f7cc1e9008b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 7 Jul 2022 01:08:45 +0200 Subject: [PATCH] Update to 6.49.1 --- 2484942b4f.patch | 70 ------------------------------------------ 6d1d17d016.patch | 34 -------------------- a4681f6962.patch | 42 ------------------------- python-hypothesis.spec | 7 +---- sources | 2 +- 5 files changed, 2 insertions(+), 153 deletions(-) delete mode 100644 2484942b4f.patch delete mode 100644 6d1d17d016.patch delete mode 100644 a4681f6962.patch diff --git a/2484942b4f.patch b/2484942b4f.patch deleted file mode 100644 index e52af0c..0000000 --- a/2484942b4f.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 2484942b4f9ff63e6c3c0dae2097a266622fc87d Mon Sep 17 00:00:00 2001 -From: Zac Hatfield-Dodds -Date: Wed, 22 Jun 2022 22:41:38 -0700 -Subject: [PATCH] Support 3.11 GenericAlias again - ---- - hypothesis-python/RELEASE.rst | 4 ++++ - .../src/hypothesis/strategies/_internal/types.py | 13 +++++-------- - 2 files changed, 9 insertions(+), 8 deletions(-) - create mode 100644 hypothesis-python/RELEASE.rst - -diff --git a/hypothesis-python/RELEASE.rst b/hypothesis-python/RELEASE.rst -new file mode 100644 -index 0000000000..6b49da62d3 ---- /dev/null -+++ b/hypothesis-python/RELEASE.rst -@@ -0,0 +1,4 @@ -+RELEASE_TYPE: patch -+ -+This patch fixes :func:`~hypothesis.strategies.from_type` on Python 3.11, -+following `python/cpython#93754 `__. -diff --git a/hypothesis-python/src/hypothesis/strategies/_internal/types.py b/hypothesis-python/src/hypothesis/strategies/_internal/types.py -index 617b360856..4e410bcf58 100644 ---- a/hypothesis-python/src/hypothesis/strategies/_internal/types.py -+++ b/hypothesis-python/src/hypothesis/strategies/_internal/types.py -@@ -39,11 +39,13 @@ - from hypothesis.strategies._internal.lazy import unwrap_strategies - from hypothesis.strategies._internal.strategies import OneOfStrategy - -+GenericAlias: typing.Any - UnionType: typing.Any - try: - # The type of PEP-604 unions (`int | str`), added in Python 3.10 -- from types import UnionType -+ from types import GenericAlias, UnionType - except ImportError: -+ GenericAlias = () - UnionType = () - - try: -@@ -51,11 +53,6 @@ - except ImportError: - typing_extensions = None # type: ignore - --try: -- from typing import _GenericAlias # type: ignore # python >= 3.7 --except ImportError: -- _GenericAlias = () -- - try: - from typing import _AnnotatedAlias # type: ignore - except ImportError: -@@ -298,7 +295,7 @@ def find_annotated_strategy(annotated_type): # pragma: no cover - def has_type_arguments(type_): - """Decides whethere or not this type has applied type arguments.""" - args = getattr(type_, "__args__", None) -- if args and isinstance(type_, _GenericAlias): -+ if args and isinstance(type_, (typing._GenericAlias, GenericAlias)): - # There are some cases when declared types do already have type arguments - # Like `Sequence`, that is `_GenericAlias(abc.Sequence[T])[T]` - parameters = getattr(type_, "__parameters__", None) -@@ -312,7 +309,7 @@ def is_generic_type(type_): - # The ugly truth is that `MyClass`, `MyClass[T]`, and `MyClass[int]` are very different. - # We check for `MyClass[T]` and `MyClass[int]` with the first condition, - # while the second condition is for `MyClass`. -- return isinstance(type_, typing_root_type) or ( -+ return isinstance(type_, typing_root_type + (GenericAlias,)) or ( - isinstance(type_, type) and typing.Generic in type_.__mro__ - ) - diff --git a/6d1d17d016.patch b/6d1d17d016.patch deleted file mode 100644 index 8b27ae8..0000000 --- a/6d1d17d016.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 6d1d17d016d092146b620e4f9338f9b125e33ded Mon Sep 17 00:00:00 2001 -From: Florian Bruhin -Date: Tue, 26 Apr 2022 11:16:27 +0200 -Subject: [PATCH] Adjust imports of deprecated sre_* modules in Python 3.11 - -Fixes #3309 -See https://github.com/python/cpython/issues/91308 - -I don't see a way to avoid relying on Python 3.11 internals here, so -this instead just adjusts the imports to avoid deprecation warnings. ---- - .../src/hypothesis/strategies/_internal/regex.py | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/hypothesis-python/src/hypothesis/strategies/_internal/regex.py b/hypothesis-python/src/hypothesis/strategies/_internal/regex.py -index 5da2b3ba2d..b93e8d192b 100644 ---- a/hypothesis-python/src/hypothesis/strategies/_internal/regex.py -+++ b/hypothesis-python/src/hypothesis/strategies/_internal/regex.py -@@ -10,8 +10,13 @@ - - import operator - import re --import sre_constants as sre --import sre_parse -+ -+try: # pragma: no cover -+ import re._constants as sre -+ import re._parser as sre_parse -+except ImportError: # Python < 3.11 -+ import sre_constants as sre # type: ignore -+ import sre_parse # type: ignore - - from hypothesis import reject, strategies as st - from hypothesis.internal.charmap import as_general_categories, categories diff --git a/a4681f6962.patch b/a4681f6962.patch deleted file mode 100644 index 12f994a..0000000 --- a/a4681f6962.patch +++ /dev/null @@ -1,42 +0,0 @@ -From a4681f6962ea137db3eec059fb453929eb998fec Mon Sep 17 00:00:00 2001 -From: Zac Hatfield-Dodds -Date: Sat, 7 May 2022 23:45:33 -0600 -Subject: [PATCH] Tests work on 3.11.0b1 - -Thanks to CPython upstream fixes, these tests should now just work ---- - hypothesis-python/tests/conftest.py | 5 ----- - hypothesis-python/tests/cover/test_lookup_py37.py | 4 ---- - 2 files changed, 9 deletions(-) - -diff --git a/hypothesis-python/tests/conftest.py b/hypothesis-python/tests/conftest.py -index 988efaf70c..bcbd024903 100644 ---- a/hypothesis-python/tests/conftest.py -+++ b/hypothesis-python/tests/conftest.py -@@ -37,11 +37,6 @@ - if sys.version_info >= (3, 11): - collect_ignore_glob.append("cover/test_asyncio.py") # @asyncio.coroutine removed - -- assert sys.version_info.releaselevel == "alpha" -- # TODO: our traceback elision doesn't work with Python 3.11's nice new format yet -- collect_ignore_glob.append("cover/test_traceback_elision.py") -- collect_ignore_glob.append("pytest/test_capture.py") -- - - def pytest_configure(config): - config.addinivalue_line("markers", "slow: pandas expects this marker to exist.") -diff --git a/hypothesis-python/tests/cover/test_lookup_py37.py b/hypothesis-python/tests/cover/test_lookup_py37.py -index bdfbbecd9e..6a1955eb6b 100644 ---- a/hypothesis-python/tests/cover/test_lookup_py37.py -+++ b/hypothesis-python/tests/cover/test_lookup_py37.py -@@ -163,10 +163,6 @@ def test_resolving_standard_callable_ellipsis(x: collections.abc.Callable[..., E - assert isinstance(x(1, 2, 3, a=4, b=5, c=6), Elem) - - --@pytest.mark.skipif( -- sys.version_info[:3] == (3, 11, 0), -- reason="https://github.com/python/cpython/issues/91621", --) - @given(...) - def test_resolving_standard_callable_no_args(x: collections.abc.Callable[[], Elem]): - assert isinstance(x, collections.abc.Callable) diff --git a/python-hypothesis.spec b/python-hypothesis.spec index 3009a6e..645e54e 100644 --- a/python-hypothesis.spec +++ b/python-hypothesis.spec @@ -9,7 +9,7 @@ %endif Name: python-hypothesis -Version: 6.45.0 +Version: 6.49.1 Release: %autorelease Summary: Library for property based testing @@ -17,11 +17,6 @@ License: MPLv2.0 URL: https://github.com/HypothesisWorks/hypothesis Source0: %{url}/archive/hypothesis-python-%{version}/hypothesis-%{version}.tar.gz -# Python 3.11 fixes -Patch: https://github.com/HypothesisWorks/hypothesis/commit/6d1d17d016.patch -Patch: https://github.com/HypothesisWorks/hypothesis/commit/a4681f6962.patch -Patch: https://github.com/HypothesisWorks/hypothesis/commit/2484942b4f.patch - BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel diff --git a/sources b/sources index f8d86ee..39f6c3f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (hypothesis-6.45.0.tar.gz) = 01e4aea5ce71c476fbee52182ff07529126744eb8bb603175370d33d2e1ce49a367ef2c0ec7abf879ed2bfa25a31e1b2136e2b79bc68d4a4c200cc3159583c6c +SHA512 (hypothesis-6.49.1.tar.gz) = 14b232ad1b2c233566d26eae2be1557ce543109748b5f835f74acbc9aad6aba2d75e4f9c357ee6dbc3bc75e175413058b4796d2853921c23ff083d66424cf7b4