summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-23 18:18:04 +0200
committerMichał Górny <mgorny@gentoo.org>2022-05-23 18:47:52 +0200
commit3aa2bfc2456e536d5471bb223754e872ccb8027d (patch)
tree42ed98c16c453a995f29cdf6d63cd9584c3fc69f /dev-python
parentapp-text/grip: drop 4.6.0 (diff)
downloadgentoo-3aa2bfc2456e536d5471bb223754e872ccb8027d.tar.gz
gentoo-3aa2bfc2456e536d5471bb223754e872ccb8027d.tar.bz2
gentoo-3aa2bfc2456e536d5471bb223754e872ccb8027d.zip
dev-python/typeguard: Fix py3.10 test failures
Closes: https://bugs.gentoo.org/834957 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/typeguard/files/typeguard-2.13.3-test.patch44
-rw-r--r--dev-python/typeguard/typeguard-2.13.3-r1.ebuild5
2 files changed, 49 insertions, 0 deletions
diff --git a/dev-python/typeguard/files/typeguard-2.13.3-test.patch b/dev-python/typeguard/files/typeguard-2.13.3-test.patch
new file mode 100644
index 000000000000..3c01c018ea86
--- /dev/null
+++ b/dev-python/typeguard/files/typeguard-2.13.3-test.patch
@@ -0,0 +1,44 @@
+diff --git a/src/typeguard/__init__.py b/src/typeguard/__init__.py
+index 5684d63..27fa30b 100644
+--- a/src/typeguard/__init__.py
++++ b/src/typeguard/__init__.py
+@@ -61,22 +61,25 @@ except ImportError:
+ from typing import _ForwardRef as ForwardRef
+ evaluate_forwardref = ForwardRef._eval_type
+
+-if sys.version_info >= (3, 10):
+- from typing import is_typeddict
+-else:
+- _typed_dict_meta_types = ()
+- if sys.version_info >= (3, 8):
+- from typing import _TypedDictMeta
+- _typed_dict_meta_types += (_TypedDictMeta,)
++try:
++ from typing_extensions import is_typeddict
++except ImportError:
++ if sys.version_info >= (3, 10):
++ from typing import is_typeddict
++ else:
++ _typed_dict_meta_types = ()
++ if sys.version_info >= (3, 8):
++ from typing import _TypedDictMeta
++ _typed_dict_meta_types += (_TypedDictMeta,)
+
+- try:
+- from typing_extensions import _TypedDictMeta
+- _typed_dict_meta_types += (_TypedDictMeta,)
+- except ImportError:
+- pass
++ try:
++ from typing_extensions import _TypedDictMeta
++ _typed_dict_meta_types += (_TypedDictMeta,)
++ except ImportError:
++ pass
+
+- def is_typeddict(tp) -> bool:
+- return isinstance(tp, _typed_dict_meta_types)
++ def is_typeddict(tp) -> bool:
++ return isinstance(tp, _typed_dict_meta_types)
+
+
+ if TYPE_CHECKING:
diff --git a/dev-python/typeguard/typeguard-2.13.3-r1.ebuild b/dev-python/typeguard/typeguard-2.13.3-r1.ebuild
index b4cdda966b33..232c7feab833 100644
--- a/dev-python/typeguard/typeguard-2.13.3-r1.ebuild
+++ b/dev-python/typeguard/typeguard-2.13.3-r1.ebuild
@@ -33,6 +33,11 @@ distutils_enable_tests pytest
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+PATCHES=(
+ # backport from https://github.com/agronholm/typeguard/pull/243
+ "${FILESDIR}"/${P}-test.patch
+)
+
python_test() {
local EPYTEST_IGNORE=(
# mypy changes results from version to version