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
This commit is contained in:
parent
ac5d8358f5
commit
7771404455
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 2 02:47:44 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- 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 <tchvatal@suse.com>
|
||||
|
||||
|
@ -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
|
||||
|
37
test-sys-executable.patch
Normal file
37
test-sys-executable.patch
Normal file
@ -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:
|
Loading…
Reference in New Issue
Block a user