aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2021-04-02 09:05:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2021-04-05 18:19:17 +0000
commitd1be4e32e48cfef29024132a49f7ff9b633fdfdd (patch)
tree5c69436c38fe9ee8494358b09ca8a6dc550ec992
parent67f69764fadee1edb10318f184efd0b2183cded1 (diff)
testing/py3-typing_inspect: fix tests with python 3.9
-rw-r--r--testing/py3-typing_inspect/APKBUILD8
-rw-r--r--testing/py3-typing_inspect/python-3.9.patch35
2 files changed, 40 insertions, 3 deletions
diff --git a/testing/py3-typing_inspect/APKBUILD b/testing/py3-typing_inspect/APKBUILD
index 36d811deeaa..b2e5e56d4cd 100644
--- a/testing/py3-typing_inspect/APKBUILD
+++ b/testing/py3-typing_inspect/APKBUILD
@@ -3,14 +3,15 @@
pkgname=py3-typing_inspect
_pkgname=typing_inspect
pkgver=0.6.0
-pkgrel=0
+pkgrel=1
pkgdesc="Defines an API for runtime inspection of types defined in the Python standard typing module"
url="https://github.com/ilevkivskyi/typing_inspect"
arch="all"
license="MIT"
depends="python3 py3-mypy-extensions py3-typing-extensions"
makedepends="py3-setuptools"
-source="typing_inspect-$pkgver.tar.gz::https://github.com/ilevkivskyi/typing_inspect/archive/$pkgver.tar.gz"
+source="typing_inspect-$pkgver.tar.gz::https://github.com/ilevkivskyi/typing_inspect/archive/$pkgver.tar.gz
+ python-3.9.patch"
builddir="$srcdir/$_pkgname-$pkgver"
build() {
@@ -25,4 +26,5 @@ package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
-sha512sums="c08654d2d3887710094fa7374c2ce5fa6b79176543d478d15113d3904bb3c68cdeb08d8331b6eeb271858e96ee859fdaad18dd17237a0618072f630f34758177 typing_inspect-0.6.0.tar.gz"
+sha512sums="c08654d2d3887710094fa7374c2ce5fa6b79176543d478d15113d3904bb3c68cdeb08d8331b6eeb271858e96ee859fdaad18dd17237a0618072f630f34758177 typing_inspect-0.6.0.tar.gz
+55cb585b8b1dcd70578ab232f80fd0ca228a6ba506fec7c4d5ecf72794283527c6f58e62ecf07f2e17aa4952ee4a112210265cea244e6955b862a39d15ba329a python-3.9.patch"
diff --git a/testing/py3-typing_inspect/python-3.9.patch b/testing/py3-typing_inspect/python-3.9.patch
new file mode 100644
index 00000000000..9e667de7f98
--- /dev/null
+++ b/testing/py3-typing_inspect/python-3.9.patch
@@ -0,0 +1,35 @@
+From 16919e21936179e53df2f376c8b59b5fc44bd2dd Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Fri, 15 Jan 2021 09:22:52 -0500
+Subject: [PATCH] Fix for Python 3.9+.
+
+Fixes <https://github.com/ilevkivskyi/typing_inspect/issues/60>.
+
+Based on an idea in
+https://github.com/ilevkivskyi/typing_inspect/issues/60#issuecomment-683187584.
+---
+ typing_inspect.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/typing_inspect.py b/typing_inspect.py
+index 1ca68ed..31d05ee 100644
+--- a/typing_inspect.py
++++ b/typing_inspect.py
+@@ -21,7 +21,7 @@
+
+ if NEW_TYPING:
+ from typing import (
+- Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, ForwardRef
++ Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, _SpecialGenericAlias, ForwardRef
+ )
+ from typing_extensions import Literal
+ else:
+@@ -75,7 +75,7 @@ def is_generic_type(tp):
+ """
+ if NEW_TYPING:
+ return (isinstance(tp, type) and issubclass(tp, Generic) or
+- isinstance(tp, _GenericAlias) and
++ (isinstance(tp, _GenericAlias) or isinstance(tp, _SpecialGenericAlias)) and
+ tp.__origin__ not in (Union, tuple, ClassVar, collections.abc.Callable))
+ return (isinstance(tp, GenericMeta) and not
+ isinstance(tp, (CallableMeta, TupleMeta)))