diff --git a/.python-typing-extensions.metadata b/.python-typing-extensions.metadata new file mode 100644 index 0000000..6e6a42e --- /dev/null +++ b/.python-typing-extensions.metadata @@ -0,0 +1 @@ +c43802607d8b5c1d102401e654fcab70609fb7bc SOURCES/typing_extensions-4.9.0.tar.gz diff --git a/SOURCES/768.patch b/SOURCES/768.patch new file mode 100644 index 0000000..40c77dc --- /dev/null +++ b/SOURCES/768.patch @@ -0,0 +1,276 @@ +From 1913db5ae20e95e636471cc79208330dfe7a1d72 Mon Sep 17 00:00:00 2001 +From: Noel Evans +Date: Wed, 25 Nov 2020 22:09:44 +0000 +Subject: [PATCH 1/3] Fix tests failing with 3.10.0a2+ + +--- + .../src_py3/test_typing_extensions.py | 39 ++++++++++++++++--- + 1 file changed, 33 insertions(+), 6 deletions(-) + +diff --git a/typing_extensions/src_py3/test_typing_extensions.py b/typing_extensions/src_py3/test_typing_extensions.py +index 0222303..89c3037 100644 +--- a/typing_extensions/src_py3/test_typing_extensions.py ++++ b/typing_extensions/src_py3/test_typing_extensions.py +@@ -9,7 +9,7 @@ + from unittest import TestCase, main, skipUnless, skipIf + from typing import TypeVar, Optional + from typing import T, KT, VT # Not in __all__. +-from typing import Tuple, List, Dict, Iterator ++from typing import ForwardRef, Tuple, List, Dict, Iterator + from typing import Generic + from typing import no_type_check + from typing_extensions import NoReturn, ClassVar, Final, IntVar, Literal, Type, NewType, TypedDict +@@ -71,6 +71,9 @@ + # For checks reliant on Python 3.6 syntax changes (e.g. classvar) + PY36 = sys.version_info[:2] >= (3, 6) + ++# For checks reliant on Python 3.10 ++PY3_10 = sys.version_info[:2] >= (3, 10) ++ + # Protocols are hard to backport to the original version of typing 3.5.0 + HAVE_PROTOCOLS = sys.version_info[:3] != (3, 5, 0) + +@@ -1516,7 +1519,6 @@ def test_typeddict_errors(self): + def test_py36_class_syntax_usage(self): + self.assertEqual(LabelPoint2D.__name__, 'LabelPoint2D') + self.assertEqual(LabelPoint2D.__module__, __name__) +- self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) + self.assertEqual(LabelPoint2D.__bases__, (dict,)) + self.assertEqual(LabelPoint2D.__total__, True) + self.assertNotIsSubclass(LabelPoint2D, typing.Sequence) +@@ -1525,6 +1527,13 @@ def test_py36_class_syntax_usage(self): + self.assertEqual(not_origin['y'], 1) + other = LabelPoint2D(x=0, y=1, label='hi') + self.assertEqual(other['label'], 'hi') ++ if PY3_10: ++ self.assertEqual(LabelPoint2D.__annotations__, { ++ 'x': ForwardRef('int'), ++ 'y': ForwardRef('int'), ++ 'label': str}) ++ else: ++ self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) + + def test_pickle(self): + global EmpD # pickle wants to reference the class by name +@@ -1565,18 +1574,21 @@ def test_optional_keys(self): + def test_keys_inheritance(self): + assert BaseAnimal.__required_keys__ == frozenset(['name']) + assert BaseAnimal.__optional_keys__ == frozenset([]) +- assert BaseAnimal.__annotations__ == {'name': str} + + assert Animal.__required_keys__ == frozenset(['name']) + assert Animal.__optional_keys__ == frozenset(['tail', 'voice']) ++ ++ assert Cat.__required_keys__ == frozenset(['name', 'fur_color']) ++ assert Cat.__optional_keys__ == frozenset(['tail', 'voice']) ++ ++ @skipUnless(PY36 and not PY3_10, 'Python 3.6 and < 3.10 required') ++ def test_keys_inheritance_before_postponed_annotation_eval(self): ++ assert BaseAnimal.__annotations__ == {'name': str} + assert Animal.__annotations__ == { + 'name': str, + 'tail': bool, + 'voice': str, + } +- +- assert Cat.__required_keys__ == frozenset(['name', 'fur_color']) +- assert Cat.__optional_keys__ == frozenset(['tail', 'voice']) + assert Cat.__annotations__ == { + 'fur_color': str, + 'name': str, +@@ -1584,6 +1596,21 @@ def test_keys_inheritance(self): + 'voice': str, + } + ++ @skipUnless(PY3_10, 'Python 3.10 required') ++ def test_keys_inheritance_with_postponed_annotation_eval(self): ++ assert BaseAnimal.__annotations__ == {'name': ForwardRef('str')} ++ assert Animal.__annotations__ == { ++ 'name': ForwardRef('str'), ++ 'tail': ForwardRef('bool'), ++ 'voice': ForwardRef('str'), ++ } ++ assert Cat.__annotations__ == { ++ 'fur_color': ForwardRef('str'), ++ 'name': ForwardRef('str'), ++ 'tail': ForwardRef('bool'), ++ 'voice': ForwardRef('str'), ++ } ++ + + @skipUnless(TYPING_3_5_3, "Python >= 3.5.3 required") + class AnnotatedTests(BaseTestCase): + +From a6b50a9788cb071ff11c408a7212bef1bad9b233 Mon Sep 17 00:00:00 2001 +From: Noel Evans +Date: Wed, 25 Nov 2020 22:34:12 +0000 +Subject: [PATCH 2/3] Fix import issue + +--- + .../src_py3/test_typing_extensions.py | 24 +++++++++---------- + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/typing_extensions/src_py3/test_typing_extensions.py b/typing_extensions/src_py3/test_typing_extensions.py +index 89c3037..1c02877 100644 +--- a/typing_extensions/src_py3/test_typing_extensions.py ++++ b/typing_extensions/src_py3/test_typing_extensions.py +@@ -9,7 +9,7 @@ + from unittest import TestCase, main, skipUnless, skipIf + from typing import TypeVar, Optional + from typing import T, KT, VT # Not in __all__. +-from typing import ForwardRef, Tuple, List, Dict, Iterator ++from typing import Tuple, List, Dict, Iterator + from typing import Generic + from typing import no_type_check + from typing_extensions import NoReturn, ClassVar, Final, IntVar, Literal, Type, NewType, TypedDict +@@ -35,7 +35,7 @@ + + OLD_GENERICS = False + try: +- from typing import _type_vars, _next_in_mro, _type_check # noqa ++ from typing import _type_vars, _next_in_mro, _type_check # noqa + except ImportError: + OLD_GENERICS = True + +@@ -1529,8 +1529,8 @@ def test_py36_class_syntax_usage(self): + self.assertEqual(other['label'], 'hi') + if PY3_10: + self.assertEqual(LabelPoint2D.__annotations__, { +- 'x': ForwardRef('int'), +- 'y': ForwardRef('int'), ++ 'x': typing.ForwardRef('int'), ++ 'y': typing.ForwardRef('int'), + 'label': str}) + else: + self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) +@@ -1598,17 +1598,17 @@ def test_keys_inheritance_before_postponed_annotation_eval(self): + + @skipUnless(PY3_10, 'Python 3.10 required') + def test_keys_inheritance_with_postponed_annotation_eval(self): +- assert BaseAnimal.__annotations__ == {'name': ForwardRef('str')} ++ assert BaseAnimal.__annotations__ == {'name': typing.ForwardRef('str')} + assert Animal.__annotations__ == { +- 'name': ForwardRef('str'), +- 'tail': ForwardRef('bool'), +- 'voice': ForwardRef('str'), ++ 'name': typing.ForwardRef('str'), ++ 'tail': typing.ForwardRef('bool'), ++ 'voice': typing.ForwardRef('str'), + } + assert Cat.__annotations__ == { +- 'fur_color': ForwardRef('str'), +- 'name': ForwardRef('str'), +- 'tail': ForwardRef('bool'), +- 'voice': ForwardRef('str'), ++ 'fur_color': typing.ForwardRef('str'), ++ 'name': typing.ForwardRef('str'), ++ 'tail': typing.ForwardRef('bool'), ++ 'voice': typing.ForwardRef('str'), + } + + + +From 762584effacd447b23688acf9cbc70e453fd9601 Mon Sep 17 00:00:00 2001 +From: Noel Evans +Date: Wed, 25 Nov 2020 23:35:59 +0000 +Subject: [PATCH 3/3] Simplify change using get_type_hints + +--- + .../src_py3/test_typing_extensions.py | 43 ++++--------------- + 1 file changed, 8 insertions(+), 35 deletions(-) + +diff --git a/typing_extensions/src_py3/test_typing_extensions.py b/typing_extensions/src_py3/test_typing_extensions.py +index 1c02877..b89b396 100644 +--- a/typing_extensions/src_py3/test_typing_extensions.py ++++ b/typing_extensions/src_py3/test_typing_extensions.py +@@ -35,7 +35,7 @@ + + OLD_GENERICS = False + try: +- from typing import _type_vars, _next_in_mro, _type_check # noqa ++ from typing import _type_vars, _next_in_mro, _type_check # noqa + except ImportError: + OLD_GENERICS = True + +@@ -71,9 +71,6 @@ + # For checks reliant on Python 3.6 syntax changes (e.g. classvar) + PY36 = sys.version_info[:2] >= (3, 6) + +-# For checks reliant on Python 3.10 +-PY3_10 = sys.version_info[:2] >= (3, 10) +- + # Protocols are hard to backport to the original version of typing 3.5.0 + HAVE_PROTOCOLS = sys.version_info[:3] != (3, 5, 0) + +@@ -1519,6 +1516,7 @@ def test_typeddict_errors(self): + def test_py36_class_syntax_usage(self): + self.assertEqual(LabelPoint2D.__name__, 'LabelPoint2D') + self.assertEqual(LabelPoint2D.__module__, __name__) ++ self.assertEqual(get_type_hints(LabelPoint2D), {'x': int, 'y': int, 'label': str}) + self.assertEqual(LabelPoint2D.__bases__, (dict,)) + self.assertEqual(LabelPoint2D.__total__, True) + self.assertNotIsSubclass(LabelPoint2D, typing.Sequence) +@@ -1527,13 +1525,6 @@ def test_py36_class_syntax_usage(self): + self.assertEqual(not_origin['y'], 1) + other = LabelPoint2D(x=0, y=1, label='hi') + self.assertEqual(other['label'], 'hi') +- if PY3_10: +- self.assertEqual(LabelPoint2D.__annotations__, { +- 'x': typing.ForwardRef('int'), +- 'y': typing.ForwardRef('int'), +- 'label': str}) +- else: +- self.assertEqual(LabelPoint2D.__annotations__, {'x': int, 'y': int, 'label': str}) + + def test_pickle(self): + global EmpD # pickle wants to reference the class by name +@@ -1574,43 +1565,25 @@ def test_optional_keys(self): + def test_keys_inheritance(self): + assert BaseAnimal.__required_keys__ == frozenset(['name']) + assert BaseAnimal.__optional_keys__ == frozenset([]) ++ assert get_type_hints(BaseAnimal) == {'name': str} + + assert Animal.__required_keys__ == frozenset(['name']) + assert Animal.__optional_keys__ == frozenset(['tail', 'voice']) +- +- assert Cat.__required_keys__ == frozenset(['name', 'fur_color']) +- assert Cat.__optional_keys__ == frozenset(['tail', 'voice']) +- +- @skipUnless(PY36 and not PY3_10, 'Python 3.6 and < 3.10 required') +- def test_keys_inheritance_before_postponed_annotation_eval(self): +- assert BaseAnimal.__annotations__ == {'name': str} +- assert Animal.__annotations__ == { ++ assert get_type_hints(Animal) == { + 'name': str, + 'tail': bool, + 'voice': str, + } +- assert Cat.__annotations__ == { ++ ++ assert Cat.__required_keys__ == frozenset(['name', 'fur_color']) ++ assert Cat.__optional_keys__ == frozenset(['tail', 'voice']) ++ assert get_type_hints(Cat) == { + 'fur_color': str, + 'name': str, + 'tail': bool, + 'voice': str, + } + +- @skipUnless(PY3_10, 'Python 3.10 required') +- def test_keys_inheritance_with_postponed_annotation_eval(self): +- assert BaseAnimal.__annotations__ == {'name': typing.ForwardRef('str')} +- assert Animal.__annotations__ == { +- 'name': typing.ForwardRef('str'), +- 'tail': typing.ForwardRef('bool'), +- 'voice': typing.ForwardRef('str'), +- } +- assert Cat.__annotations__ == { +- 'fur_color': typing.ForwardRef('str'), +- 'name': typing.ForwardRef('str'), +- 'tail': typing.ForwardRef('bool'), +- 'voice': typing.ForwardRef('str'), +- } +- + + @skipUnless(TYPING_3_5_3, "Python >= 3.5.3 required") + class AnnotatedTests(BaseTestCase): diff --git a/SOURCES/773.patch b/SOURCES/773.patch new file mode 100644 index 0000000..f0033f2 --- /dev/null +++ b/SOURCES/773.patch @@ -0,0 +1,42 @@ +From 240d811b00fb1cedfc42848e6efa6137bf009e8d Mon Sep 17 00:00:00 2001 +From: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com> +Date: Sat, 2 Jan 2021 23:26:26 +0800 +Subject: [PATCH] Update test_typing_extensions.py + +--- + typing_extensions/src_py3/test_typing_extensions.py | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/typing_extensions/src_py3/test_typing_extensions.py b/typing_extensions/src_py3/test_typing_extensions.py +index b89b396..98d02a0 100644 +--- a/typing_extensions/src_py3/test_typing_extensions.py ++++ b/typing_extensions/src_py3/test_typing_extensions.py +@@ -51,6 +51,7 @@ + TYPING_3_5_1 = TYPING_LATEST or sys.version_info[:3] >= (3, 5, 1) + TYPING_3_5_3 = TYPING_LATEST or sys.version_info[:3] >= (3, 5, 3) + TYPING_3_6_1 = TYPING_LATEST or sys.version_info[:3] >= (3, 6, 1) ++TYPING_3_10_0 = TYPING_LATEST or sys.version_info[:3] >= (3, 10, 0) + + # For typing versions where issubclass(...) and + # isinstance(...) checks are forbidden. +@@ -1240,8 +1241,9 @@ class P(PR[int, str], Protocol): + self.assertIsSubclass(P, PR) + with self.assertRaises(TypeError): + PR[int] +- with self.assertRaises(TypeError): +- PR[int, 1] ++ if not TYPING_3_10_0: ++ with self.assertRaises(TypeError): ++ PR[int, 1] + class P1(Protocol, Generic[T]): + def bar(self, x: T) -> str: ... + class P2(Generic[T], Protocol): +@@ -1254,7 +1256,7 @@ class Test: + def bar(self, x: str) -> str: + return x + self.assertIsInstance(Test(), PSub) +- if TYPING_3_5_3: ++ if TYPING_3_5_3 and not TYPING_3_10_0: + with self.assertRaises(TypeError): + PR[int, ClassVar] + diff --git a/SOURCES/README.md b/SOURCES/README.md new file mode 100644 index 0000000..dfd4512 --- /dev/null +++ b/SOURCES/README.md @@ -0,0 +1,3 @@ +# python-typing-extensions + +The python-typing-extensions package \ No newline at end of file diff --git a/SPECS/python-typing-extensions.spec b/SPECS/python-typing-extensions.spec new file mode 100644 index 0000000..a592ee0 --- /dev/null +++ b/SPECS/python-typing-extensions.spec @@ -0,0 +1,181 @@ +Name: python-typing-extensions +Version: 4.9.0 +Release: 1%{?dist} +Summary: Python Typing Extensions + +License: PSF-2.0 +URL: https://pypi.org/project/typing-extensions/ +Source0: %{pypi_source typing_extensions} + +BuildArch: noarch + +BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros +BuildRequires: python3-test + + +%global _description %{expand: +The typing_extensions module serves two related purposes: + + Enable use of new type system features on older Python versions. + For example, typing.TypeGuard is new in Python 3.10, but typing_extensions + allows users on previous Python versions to use it too. + + Enable experimentation with new type system PEPs before they are accepted and + added to the typing module. + +typing_extensions is treated specially by static type checkers such as mypy and +pyright. Objects defined in typing_extensions are treated the same way as +equivalent forms in typing. + +typing_extensions uses Semantic Versioning. The major version will be +incremented only for backwards-incompatible changes. Therefore, it's safe to +depend on typing_extensions like this: typing_extensions >=x.y, <(x+1), +where x.y is the first version that includes all features you need.} + +%description %_description + +%package -n python3-typing-extensions +Summary: %{summary} + +%description -n python3-typing-extensions %_description + + +%prep +%autosetup -n typing_extensions-%{version} + + +%generate_buildrequires +%pyproject_buildrequires + + +%build +%pyproject_wheel + + +%install +%pyproject_install + +%pyproject_save_files typing_extensions + + +%check +cd src +%{python3} -m unittest discover + + +%files -n python3-typing-extensions -f %{pyproject_files} +%license LICENSE +%doc CHANGELOG.md +%doc README.md + + +%changelog +* Sun Dec 10 2023 Jonny Heggheim - 4.9.0-1 +- Updated to version 4.9.0 + +* Mon Sep 18 2023 Jonny Heggheim - 4.8.0-1 +- Updated to version 4.8.0 + +* Fri Jul 21 2023 Fedora Release Engineering - 4.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sun Jul 02 2023 Jonny Heggheim - 4.7.1-1 +- Updated to version 4.7.1 + +* Thu Jun 29 2023 Python Maint - 4.7.0-2 +- Rebuilt for Python 3.12 + +* Wed Jun 28 2023 Jonny Heggheim - 4.7.0-1 +- Updated to version 4.7.0 + +* Tue Jun 13 2023 Python Maint - 4.6.3-2 +- Rebuilt for Python 3.12 + +* Sat Jun 03 2023 Jonny Heggheim - 4.6.3-1 +- Updated to version 4.6.3 + +* Thu May 25 2023 Jonny Heggheim - 4.6.2-1 +- Updated to version 4.6.2 + +* Wed May 24 2023 Jonny Heggheim - 4.6.1-1 +- Updated to version 4.6.1 + +* Tue May 23 2023 Jonny Heggheim - 4.6.0-1 +- Updated to version 4.6.0 + +* Wed Feb 15 2023 Jonny Heggheim - 4.5.0-1 +- Updated to version 4.5.0 + +* Fri Jan 20 2023 Fedora Release Engineering - 4.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Nov 29 2022 Benjamin A. Beasley - 4.4.0-2 +- Update License to SPDX + +* Thu Nov 24 2022 Jonny Heggheim - 4.4.0-1 +- Updated to version 4.4.0 + +* Fri Jul 22 2022 Fedora Release Engineering - 4.2.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 4.2.0-4 +- Rebuilt for Python 3.11 + +* Mon May 23 2022 Benjamin A. Beasley - 4.2.0-3 +- Stop using deprecated zero-argument pypi_source macro + +* Sun May 22 2022 Jonny Heggheim - 4.2.0-2 +- Removed unused build depenencies + +* Sat Apr 30 2022 Jonny Heggheim - 4.2.0-1 +- Updated to version 4.2.0 + +* Fri Jan 21 2022 Fedora Release Engineering - 3.10.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Aug 31 2021 Fabian Affolter - 3.10.0.2-1 +- Update to latest upstream release 3.10.0.2 (closes rhbz#1955959) + +* Thu Aug 26 2021 Fabian Affolter - 3.10.0.0-1 +- Update to latest upstream release 3.10.0.0 (closes rhbz#1955959) + +* Fri Jul 23 2021 Fedora Release Engineering - 3.7.4.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 3.7.4.3-3 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 3.7.4.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sun Aug 23 2020 Fabian Affolter - 3.7.4.3-1 +- Update to latest upstream release 3.7.4.3 (rhbz#1871451) + +* Wed Jul 29 2020 Fedora Release Engineering - 3.7.4.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 3.7.4.2-2 +- Rebuilt for Python 3.9 + +* Sat Apr 11 2020 Fabian Affolter - 3.7.4.2-1 +- Support for Python 3.9 (rhbz#1808663) +- Update to latest upstream release 3.7.4.2 (rhbz#1766182) + +* Thu Jan 30 2020 Fedora Release Engineering - 3.7.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Oct 03 2019 Miro Hrončok - 3.7.4-4 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Mon Aug 19 2019 Miro Hrončok - 3.7.4-3 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 3.7.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Jul 12 2019 Jonny Heggheim - 3.7.4-1 +- Updated to 3.7.4 + +* Sun Mar 31 2019 Jonny Heggheim - 3.7.2-1 +- Inital packaging