From 7771404455e92ee7c36026907c5d264ce18e7f3a79c2e2473f13a2c892238291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 2 Mar 2019 13:59:52 +0000 Subject: [PATCH 1/4] Accepting request 680745 from home:jayvdb:coala:python3-bears - Add support for Python <3.5, using upstream commit as test-sys-executable.patch to fix the tests, replacing custom sed. - Remove unnecessary buid dependency on pytest and pytest-xdist OBS-URL: https://build.opensuse.org/request/show/680745 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typing_extensions?expand=0&rev=7 --- python-typing_extensions.changes | 7 ++++++ python-typing_extensions.spec | 28 ++++++++++++++++-------- test-sys-executable.patch | 37 ++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 test-sys-executable.patch diff --git a/python-typing_extensions.changes b/python-typing_extensions.changes index 806f5de..92c1b03 100644 --- a/python-typing_extensions.changes +++ b/python-typing_extensions.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Mar 2 02:47:44 UTC 2019 - John Vandenberg + +- Add support for Python <3.5, using upstream commit as + test-sys-executable.patch to fix the tests, replacing custom sed. +- Remove unnecessary buid dependency on pytest and pytest-xdist + ------------------------------------------------------------------- Thu Feb 28 09:01:37 UTC 2019 - Tomáš Chvátal diff --git a/python-typing_extensions.spec b/python-typing_extensions.spec index 98fcf19..5b56570 100644 --- a/python-typing_extensions.spec +++ b/python-typing_extensions.spec @@ -16,7 +16,6 @@ # -%define skip_python2 1 %define modname typing_extensions %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-typing_extensions @@ -27,13 +26,23 @@ License: Python-2.0 Group: Development/Languages/Python URL: https://github.com/python/typing/ Source0: https://files.pythonhosted.org/packages/source/t/typing_extensions/%{modname}-%{version}.tar.gz -BuildRequires: %{python_module pytest >= 3.0} -BuildRequires: %{python_module pytest-xdist >= 1.18} +# The patch has been adjusted for fuzz +Patch0: https://github.com/python/typing/commit/1f49677.patch#/test-sys-executable.patch BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module testsuite} +BuildRequires: %{python_module typing} +%if 0%{?suse_version} > 1320 +BuildRequires: python3-testsuite +%endif BuildRequires: fdupes BuildRequires: python-rpm-macros +%if %{python3_version_nodots} < 35 +Requires: python3-typing +%endif +%ifpython2 +Requires: python2-typing +%endif BuildArch: noarch + %python_subpackages %description @@ -55,8 +64,7 @@ Python versions or requires experimental types. %prep %setup -q -n %{modname}-%{version} -# Workaround https://github.com/python/typing/pull/615 -sed -i 's/python -OO/python3 -OO/' src_py3/test_typing_extensions.py +%patch0 -p1 %build %python_build @@ -66,12 +74,14 @@ sed -i 's/python -OO/python3 -OO/' src_py3/test_typing_extensions.py %fdupes %{buildroot}%{python3_sitelib} %check -cd src_py3 -%__python3 test_typing_extensions.py +# X.Y -> X +%{python_expand current_bin_suffix=%{$python_bin_suffix} +$python src_py${current_bin_suffix:0:1}/test_typing_extensions.py +} %files %{python_files} %license LICENSE %doc README.rst -%{python3_sitelib}/* +%{python_sitelib}/* %changelog diff --git a/test-sys-executable.patch b/test-sys-executable.patch new file mode 100644 index 0000000..f35267a --- /dev/null +++ b/test-sys-executable.patch @@ -0,0 +1,37 @@ +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 -ru typing_extensions-3.7.2-orig/src_py2/test_typing_extensions.py typing_extensions-3.7.2/src_py2/test_typing_extensions.py +--- typing_extensions-3.7.2-orig/src_py2/test_typing_extensions.py 2019-01-12 22:58:29.000000000 +0700 ++++ typing_extensions-3.7.2/src_py2/test_typing_extensions.py 2019-03-02 09:04:22.076991388 +0700 +@@ -860,7 +860,8 @@ + 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 -ru typing_extensions-3.7.2-orig/src_py3/test_typing_extensions.py typing_extensions-3.7.2/src_py3/test_typing_extensions.py +--- typing_extensions-3.7.2-orig/src_py3/test_typing_extensions.py 2019-01-12 22:58:30.000000000 +0700 ++++ typing_extensions-3.7.2/src_py3/test_typing_extensions.py 2019-03-02 09:04:28.645047489 +0700 +@@ -1389,7 +1389,8 @@ + 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: From 211114f2afa60207730e48dca4a136d00cfdbe443f34b3336dad1421fa74016d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 2 Mar 2019 14:12:18 +0000 Subject: [PATCH 2/4] - Rebase the patch to the current git state OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typing_extensions?expand=0&rev=8 --- python-typing_extensions.changes | 5 +++++ test-sys-executable.patch | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/python-typing_extensions.changes b/python-typing_extensions.changes index 92c1b03..b199057 100644 --- a/python-typing_extensions.changes +++ b/python-typing_extensions.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Mar 2 14:11:52 UTC 2019 - Tomáš Chvátal + +- Rebase the patch to the current git state + ------------------------------------------------------------------- Sat Mar 2 02:47:44 UTC 2019 - John Vandenberg diff --git a/test-sys-executable.patch b/test-sys-executable.patch index f35267a..6f9bec9 100644 --- a/test-sys-executable.patch +++ b/test-sys-executable.patch @@ -9,10 +9,11 @@ Not whatever "python" might be. typing_extensions/src_py3/test_typing_extensions.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -diff -ru typing_extensions-3.7.2-orig/src_py2/test_typing_extensions.py typing_extensions-3.7.2/src_py2/test_typing_extensions.py ---- typing_extensions-3.7.2-orig/src_py2/test_typing_extensions.py 2019-01-12 22:58:29.000000000 +0700 -+++ typing_extensions-3.7.2/src_py2/test_typing_extensions.py 2019-03-02 09:04:22.076991388 +0700 -@@ -860,7 +860,8 @@ +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: @@ -22,10 +23,11 @@ diff -ru typing_extensions-3.7.2-orig/src_py2/test_typing_extensions.py typing_e stderr=subprocess.STDOUT, shell=True) except subprocess.CalledProcessError: -diff -ru typing_extensions-3.7.2-orig/src_py3/test_typing_extensions.py typing_extensions-3.7.2/src_py3/test_typing_extensions.py ---- typing_extensions-3.7.2-orig/src_py3/test_typing_extensions.py 2019-01-12 22:58:30.000000000 +0700 -+++ typing_extensions-3.7.2/src_py3/test_typing_extensions.py 2019-03-02 09:04:28.645047489 +0700 -@@ -1389,7 +1389,8 @@ +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: From fa1209d8dd8ee304adc3ebdb6fdd5855375aee116b7370bbfd6bcb908aa0dd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 2 Mar 2019 14:14:41 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typing_extensions?expand=0&rev=9 --- python-typing_extensions.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python-typing_extensions.spec b/python-typing_extensions.spec index 5b56570..4c2149c 100644 --- a/python-typing_extensions.spec +++ b/python-typing_extensions.spec @@ -26,8 +26,7 @@ License: Python-2.0 Group: Development/Languages/Python URL: https://github.com/python/typing/ Source0: https://files.pythonhosted.org/packages/source/t/typing_extensions/%{modname}-%{version}.tar.gz -# The patch has been adjusted for fuzz -Patch0: https://github.com/python/typing/commit/1f49677.patch#/test-sys-executable.patch +Patch0: test-sys-executable.patch BuildRequires: %{python_module setuptools} BuildRequires: %{python_module typing} %if 0%{?suse_version} > 1320 From 44c1e90baf3659e4d758021f37d3decbf53316a60ce7ee7bce8a9571a9fb8ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Sat, 2 Mar 2019 15:23:18 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typing_extensions?expand=0&rev=10 --- python-typing_extensions.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-typing_extensions.spec b/python-typing_extensions.spec index 4c2149c..8dbaeb6 100644 --- a/python-typing_extensions.spec +++ b/python-typing_extensions.spec @@ -63,7 +63,7 @@ Python versions or requires experimental types. %prep %setup -q -n %{modname}-%{version} -%patch0 -p1 +%patch0 -p2 %build %python_build