mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-08 13:56:40 +02:00
testing/py3-typing_inspect: fix tests with python 3.9
This commit is contained in:
parent
67f69764fa
commit
d1be4e32e4
@ -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"
|
||||
|
||||
35
testing/py3-typing_inspect/python-3.9.patch
Normal file
35
testing/py3-typing_inspect/python-3.9.patch
Normal file
@ -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)))
|
||||
Loading…
x
Reference in New Issue
Block a user