Merge branch 'master' of ssh://pkgs.fedoraproject.org/rpms/python-typing-extensions

This commit is contained in:
Fabian Affolter 2020-08-23 20:11:17 +02:00
commit cbda745d93
No known key found for this signature in database
GPG Key ID: E23CD2DD36A4397F
3 changed files with 54 additions and 40 deletions

View File

@ -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:

44
fix_tests_for_py39.patch Normal file
View File

@ -0,0 +1,44 @@
From 501aa69ce62db361f1bc267105565ba6199d1f9b Mon Sep 17 00:00:00 2001
From: Lumir Balhar <lbalhar@redhat.com>
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)
"<class 'typing.Annotated'>"
but in Python 3.8 and lower:
>>> repr(Annotated)
"<class 'typing_extensions.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

View File

@ -9,6 +9,9 @@ License: Python
URL: https://pypi.org/project/typing-extensions/ URL: https://pypi.org/project/typing-extensions/
Source0: %{pypi_source} Source0: %{pypi_source}
# The same fix proposed upstream: https://github.com/python/typing/pull/729
Patch0: fix_tests_for_py39.patch
BuildArch: noarch BuildArch: noarch
%description %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. must be compatible with multiple Python versions or requires experimental types.
%prep %prep
%autosetup -n %{srcname}-%{version} %autosetup -n %{srcname}-%{version} -p2
%build %build
%py3_build %py3_build
@ -79,6 +82,12 @@ must be compatible with multiple Python versions or requires experimental types.
* Sun Aug 23 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.7.4.3-1 * Sun Aug 23 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.7.4.3-1
- Update to latest upstream release 3.7.4.3 (rhbz#1871451) - Update to latest upstream release 3.7.4.3 (rhbz#1871451)
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.7.4.2-2
- Rebuilt for Python 3.9
* Sat Apr 11 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.7.4.2-1 * Sat Apr 11 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.7.4.2-1
- Support for Python 3.9 (rhbz#1808663) - Support for Python 3.9 (rhbz#1808663)
- Update to latest upstream release 3.7.4.2 (rhbz#1766182) - Update to latest upstream release 3.7.4.2 (rhbz#1766182)