From acf13f99dcb3b116a028b29366fd6281eefd38808423163021568827abcb5574 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 7 Jan 2023 23:10:15 +0000 Subject: [PATCH] - update to 0.8.0: * Python 3.9 support * support PEO 591 * Require newer typing extension * Python 3.10 support * Add support for UnionType in get_args - drop typing_inspect-pr69-py39-GenericAlias.patch (upstream) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typing-inspect?expand=0&rev=5 --- python-typing-inspect.changes | 11 +++ python-typing-inspect.spec | 6 +- typing_inspect-0.6.0.tar.gz | 3 - typing_inspect-0.8.0.tar.gz | 3 + typing_inspect-pr69-py39-GenericAlias.patch | 88 --------------------- 5 files changed, 16 insertions(+), 95 deletions(-) delete mode 100644 typing_inspect-0.6.0.tar.gz create mode 100644 typing_inspect-0.8.0.tar.gz delete mode 100644 typing_inspect-pr69-py39-GenericAlias.patch diff --git a/python-typing-inspect.changes b/python-typing-inspect.changes index 69291b8..c3a9cb8 100644 --- a/python-typing-inspect.changes +++ b/python-typing-inspect.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Sat Jan 7 16:17:47 UTC 2023 - Dirk Müller + +- update to 0.8.0: + * Python 3.9 support + * support PEO 591 + * Require newer typing extension + * Python 3.10 support + * Add support for UnionType in get_args +- drop typing_inspect-pr69-py39-GenericAlias.patch (upstream) + ------------------------------------------------------------------- Sun Mar 21 13:52:12 UTC 2021 - Ben Greiner diff --git a/python-typing-inspect.spec b/python-typing-inspect.spec index 19f52dd..63c48ee 100644 --- a/python-typing-inspect.spec +++ b/python-typing-inspect.spec @@ -1,7 +1,7 @@ # # spec file for package python-typing-inspect # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,15 +18,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-typing-inspect -Version: 0.6.0 +Version: 0.8.0 Release: 0 Summary: Python runtime inspection utilities for typing License: MIT Group: Development/Languages/Python URL: https://github.com/ilevkivskyi/typing_inspect Source: https://files.pythonhosted.org/packages/source/t/typing_inspect/typing_inspect-%{version}.tar.gz -# PATCH-FIX-UPSTREAM typing_inspect-pr69-py39-GenericAlias.patch -- backport of gh#ilevkivskyi/typing_inspect#69 -Patch0: typing_inspect-pr69-py39-GenericAlias.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros diff --git a/typing_inspect-0.6.0.tar.gz b/typing_inspect-0.6.0.tar.gz deleted file mode 100644 index 630d561..0000000 --- a/typing_inspect-0.6.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f1b1dd25908dbfd81d3bebc218011531e7ab614ba6e5bf7826d887c834afab7 -size 12229 diff --git a/typing_inspect-0.8.0.tar.gz b/typing_inspect-0.8.0.tar.gz new file mode 100644 index 0000000..65961eb --- /dev/null +++ b/typing_inspect-0.8.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b1ff0c400943b6145df8119c41c244ca8207f1f10c9c057aeed1560e4806e3d +size 13550 diff --git a/typing_inspect-pr69-py39-GenericAlias.patch b/typing_inspect-pr69-py39-GenericAlias.patch deleted file mode 100644 index 7eba881..0000000 --- a/typing_inspect-pr69-py39-GenericAlias.patch +++ /dev/null @@ -1,88 +0,0 @@ -diff --git a/typing_inspect.py b/typing_inspect.py -index 2444027..896f1a9 100644 ---- a/typing_inspect.py -+++ b/typing_inspect.py -@@ -23,6 +23,11 @@ if NEW_TYPING: - Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, ForwardRef - ) - from typing_extensions import Literal -+ if sys.version_info[:3] >= (3, 9, 0): -+ from typing import _SpecialGenericAlias -+ typingGenericAlias = (_GenericAlias, _SpecialGenericAlias) -+ else: -+ typingGenericAlias = (_GenericAlias, ) - else: - from typing import ( - Callable, CallableMeta, Union, Tuple, TupleMeta, TypeVar, GenericMeta, _ForwardRef -@@ -74,7 +79,7 @@ def is_generic_type(tp): - """ - if NEW_TYPING: - return (isinstance(tp, type) and issubclass(tp, Generic) or -- isinstance(tp, _GenericAlias) and -+ isinstance(tp, typingGenericAlias) and - tp.__origin__ not in (Union, tuple, ClassVar, collections.abc.Callable)) - return (isinstance(tp, GenericMeta) and not - isinstance(tp, (CallableMeta, TupleMeta))) -@@ -100,7 +105,7 @@ def is_callable_type(tp): - get_origin(tp) is collections.abc.Callable # Callable prior to Python 3.7 - """ - if NEW_TYPING: -- return (tp is Callable or isinstance(tp, _GenericAlias) and -+ return (tp is Callable or isinstance(tp, typingGenericAlias) and - tp.__origin__ is collections.abc.Callable or - isinstance(tp, type) and issubclass(tp, Generic) and - issubclass(tp, collections.abc.Callable)) -@@ -126,7 +131,7 @@ def is_tuple_type(tp): - get_origin(tp) is tuple # Tuple prior to Python 3.7 - """ - if NEW_TYPING: -- return (tp is Tuple or isinstance(tp, _GenericAlias) and -+ return (tp is Tuple or isinstance(tp, typingGenericAlias) and - tp.__origin__ is tuple or - isinstance(tp, type) and issubclass(tp, Generic) and - issubclass(tp, tuple)) -@@ -164,14 +169,14 @@ def is_union_type(tp): - """ - if NEW_TYPING: - return (tp is Union or -- isinstance(tp, _GenericAlias) and tp.__origin__ is Union) -+ isinstance(tp, typingGenericAlias) and tp.__origin__ is Union) - return type(tp) is _Union - - - def is_literal_type(tp): - if NEW_TYPING: - return (tp is Literal or -- isinstance(tp, _GenericAlias) and tp.__origin__ is Literal) -+ isinstance(tp, typingGenericAlias) and tp.__origin__ is Literal) - return WITH_LITERAL and type(tp) is _Literal - - -@@ -196,7 +201,7 @@ def is_classvar(tp): - """ - if NEW_TYPING: - return (tp is ClassVar or -- isinstance(tp, _GenericAlias) and tp.__origin__ is ClassVar) -+ isinstance(tp, typingGenericAlias) and tp.__origin__ is ClassVar) - elif WITH_CLASSVAR: - return type(tp) is _ClassVar - else: -@@ -262,7 +267,7 @@ def get_origin(tp): - get_origin(List[Tuple[T, T]][int]) == list # List prior to Python 3.7 - """ - if NEW_TYPING: -- if isinstance(tp, _GenericAlias): -+ if isinstance(tp, typingGenericAlias): - return tp.__origin__ if tp.__origin__ is not ClassVar else None - if tp is Generic: - return Generic -@@ -327,7 +332,7 @@ def get_parameters(tp): - else: - return () - elif NEW_TYPING: -- if (isinstance(tp, _GenericAlias) or -+ if (isinstance(tp, typingGenericAlias) or - isinstance(tp, type) and issubclass(tp, Generic) and - tp is not Generic): - return tp.__parameters__ -