diff --git a/0001-Run-the-tests-using-the-current-Python-executable.patch b/0001-Run-the-tests-using-the-current-Python-executable.patch deleted file mode 100644 index 8d3b509..0000000 --- a/0001-Run-the-tests-using-the-current-Python-executable.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 1f49677868a60ed697b0eafb2fb56471233b4ea5 Mon Sep 17 00:00:00 2001 -From: "Michael R. Crusoe" <1330696+mr-c@users.noreply.github.com> -Date: Thu, 14 Feb 2019 12:25:27 +0200 -Subject: [PATCH] Run the tests using the current Python executable (#615) - -Not whatever "python" might be. ---- - typing_extensions/src_py2/test_typing_extensions.py | 3 ++- - typing_extensions/src_py3/test_typing_extensions.py | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/typing_extensions/src_py2/test_typing_extensions.py b/typing_extensions/src_py2/test_typing_extensions.py -index eb5acf3..922d8cd 100644 ---- a/typing_extensions/src_py2/test_typing_extensions.py -+++ b/typing_extensions/src_py2/test_typing_extensions.py -@@ -860,7 +860,8 @@ def test_typing_extensions_compiles_with_opt(self): - file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), - 'typing_extensions.py') - try: -- subprocess.check_output('python -OO {}'.format(file_path), -+ subprocess.check_output('{} -OO {}'.format(sys.executable, -+ file_path), - stderr=subprocess.STDOUT, - shell=True) - except subprocess.CalledProcessError: -diff --git a/typing_extensions/src_py3/test_typing_extensions.py b/typing_extensions/src_py3/test_typing_extensions.py -index eb0c64f..815e425 100644 ---- a/typing_extensions/src_py3/test_typing_extensions.py -+++ b/typing_extensions/src_py3/test_typing_extensions.py -@@ -1389,7 +1389,8 @@ def test_typing_extensions_compiles_with_opt(self): - file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), - 'typing_extensions.py') - try: -- subprocess.check_output('python -OO {}'.format(file_path), -+ subprocess.check_output('{} -OO {}'.format(sys.executable, -+ file_path), - stderr=subprocess.STDOUT, - shell=True) - except subprocess.CalledProcessError: diff --git a/fix_tests_for_py39.patch b/fix_tests_for_py39.patch new file mode 100644 index 0000000..af84867 --- /dev/null +++ b/fix_tests_for_py39.patch @@ -0,0 +1,44 @@ +From 501aa69ce62db361f1bc267105565ba6199d1f9b Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Thu, 28 May 2020 13:24:02 +0200 +Subject: [PATCH] Use regex to allow `typing` or `typing_extensions` module + name + +This is useful for testing with Python 3.9 where: + +>>> repr(Annotated) +"" + +but in Python 3.8 and lower: + +>>> repr(Annotated) +"" +--- + typing_extensions/src_py3/test_typing_extensions.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/typing_extensions/src_py3/test_typing_extensions.py b/typing_extensions/src_py3/test_typing_extensions.py +index 04edac2..2858945 100644 +--- a/typing_extensions/src_py3/test_typing_extensions.py ++++ b/typing_extensions/src_py3/test_typing_extensions.py +@@ -1588,13 +1588,13 @@ class TypedDictTests(BaseTestCase): + class AnnotatedTests(BaseTestCase): + + def test_repr(self): +- self.assertEqual( ++ self.assertRegex( + repr(Annotated[int, 4, 5]), +- "typing_extensions.Annotated[int, 4, 5]" ++ r"typing(?:_extensions|)\.Annotated\[int, 4, 5\]" + ) +- self.assertEqual( ++ self.assertRegex( + repr(Annotated[List[int], 4, 5]), +- "typing_extensions.Annotated[typing.List[int], 4, 5]" ++ r"typing(?:_extensions|)\.Annotated\[typing\.List\[int\], 4, 5\]" + ) + + def test_flatten(self): +-- +2.26.2 + diff --git a/python-typing-extensions.spec b/python-typing-extensions.spec index b8f70d8..1b2f841 100644 --- a/python-typing-extensions.spec +++ b/python-typing-extensions.spec @@ -9,6 +9,9 @@ License: Python URL: https://pypi.org/project/typing-extensions/ Source0: %{pypi_source} +# The same fix proposed upstream: https://github.com/python/typing/pull/729 +Patch0: fix_tests_for_py39.patch + BuildArch: noarch %description @@ -57,7 +60,7 @@ module from PyPi instead of using this one unless specifically writing code that must be compatible with multiple Python versions or requires experimental types. %prep -%autosetup -n %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} -p2 %build %py3_build @@ -79,6 +82,12 @@ must be compatible with multiple Python versions or requires experimental types. * 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)