From 2647c1b9cce13e8361f73443c4edea104a820a504f4a292a2e50fe2ea9aafb0e Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 30 Nov 2020 15:01:32 +0000 Subject: [PATCH] Accepting request 851543 from home:bnavigator:branches:devel:languages:python:numeric - Support multiple python3 flavors gh#openSUSE/python-rpm-macros#66 * Fix pytest call expansion * Fix f2py entry point OBS-URL: https://build.opensuse.org/request/show/851543 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=78 --- python-numpy.changes | 7 +++++++ python-numpy.spec | 24 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/python-numpy.changes b/python-numpy.changes index d033b90..516ea6d 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Nov 28 16:08:40 UTC 2020 - Benjamin Greiner + +- Support multiple python3 flavors gh#openSUSE/python-rpm-macros#66 + * Fix pytest call expansion + * Fix f2py entry point + ------------------------------------------------------------------- Fri Oct 2 13:29:32 UTC 2020 - Stefan BrĂ¼ns diff --git a/python-numpy.spec b/python-numpy.spec index 5c8c8b0..8322a48 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -256,12 +256,17 @@ mkdir testing pushd testing # boo#1148173 gh#numpy/numpy#14438 %ifarch ppc64 ppc64le -%define skiptest -k "not test_generalized_sq" -%pytest_arch -n auto --pyargs numpy %{buildroot}%{python_sitearch}/numpy -k "test_generalized_sq" || true +test_failok="test_generalized_sq" %endif -%pytest_arch -n auto --pyargs numpy %{buildroot}%{python_sitearch}/numpy %{?skiptest} +%{python_expand # for all python3 flavors +export PYTHONPATH=%{buildroot}%{$python_sitearch} +export PYTHONDONTWRITEBYTECODE=1 +testcall="pytest-%{$python_bin_suffix} -n auto %{buildroot}%{$python_sitearch}/numpy" +[ -n "$test_failok" ] && ${testcall} -k "$test_failok" || true +${testcall} ${test_failok:+-k "not ($test_failok)"} +rm -Rf %{buildroot}%{$python_sitearch}/numpy/.pytest_cache +} popd -rm -Rf %{buildroot}%{python_sitearch}/numpy/.pytest_cache %endif %if %{without hpc} @@ -276,7 +281,10 @@ rm -Rf %{buildroot}%{python_sitearch}/numpy/.pytest_cache %doc README.md THANKS.txt %if %{without hpc} %python_alternative %{_bindir}/f2py -%python3_only %{_bindir}/f2py3* +%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" +%{_bindir}/f2py3 +%endif +%{_bindir}/f2py%{python_bin_suffix} %{python_sitearch}/numpy/ %{python_sitearch}/numpy-%{version}-py*.egg-info %license %{python_sitearch}/numpy/LICENSE.txt @@ -285,7 +293,11 @@ rm -Rf %{buildroot}%{python_sitearch}/numpy/.pytest_cache %exclude %{python_sitearch}/numpy/f2py/src/ %exclude %{python_sitearch}/numpy/core/lib/libnpymath.a %else -%python3_only %{p_bindir}/f2py* +%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" +%{p_bindir}/f2py +%{p_bindir}/f2py3 +%endif +%{p_bindir}/f2py%{python_bin_suffix} %{p_python_sitearch}/numpy/ %{p_python_sitearch}/numpy-%{version}-py*.egg-info %license %{p_python_sitearch}/numpy/LICENSE.txt