From a7ec7495ab795e0dfe062ee749217048151a8d5a3244d458af29f9fa0f9826b6 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 9 Dec 2021 22:23:44 +0000 Subject: [PATCH] Accepting request 938267 from home:bnavigator:python-rpm-macros - Ignore Python 3.10 deprecation warnings OBS-URL: https://build.opensuse.org/request/show/938267 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-numpy?expand=0&rev=104 --- python-numpy.changes | 5 +++++ python-numpy.spec | 27 ++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/python-numpy.changes b/python-numpy.changes index 8d4fea5..0f3110d 100644 --- a/python-numpy.changes +++ b/python-numpy.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Dec 9 14:43:32 UTC 2021 - Ben Greiner + +- Ignore Python 3.10 deprecation warnings + ------------------------------------------------------------------- Sun Dec 5 07:26:13 UTC 2021 - Matej Cepl diff --git a/python-numpy.spec b/python-numpy.spec index e489f24..2e49616 100644 --- a/python-numpy.spec +++ b/python-numpy.spec @@ -261,9 +261,16 @@ EOF %check %if %{without hpc} export PATH="%{buildroot}%{_bindir}:$PATH" -mkdir testing -cp numpy/conftest.py testing/ + +mkdir -p testing +cp pytest.ini testing/ pushd testing + +# Python 3.10 deprecated distutils. This is going to be fixed in numpy 1.22 gh#numpy/numpy#20419 +echo ' ignore:.*distutils.*:DeprecationWarning' >> pytest.ini +# Fixed in numpy 1.21.5 - gh#numpy/numpy#20467 +echo ' ignore:.*load_module.*:DeprecationWarning' >> pytest.ini + # flaky tests test_failok+=" or test_structured_object_indexing" test_failok+=" or test_structured_object_item_setting" @@ -289,15 +296,21 @@ test_failok+=" or test_float_remainder_overflow" test_failok+=" or test_fpclass" test_failok+=" or test_float" %endif + +echo " +import sys +import numpy +numpy.test(label='full', verbose=2, + extra_argv=['-v', '-n', 'auto', '-k'] + sys.argv[1:]) +" > runobstest.py + %{python_expand # for all python3 flavors export PYTHONPATH=%{buildroot}%{$python_sitearch} export PYTHONDONTWRITEBYTECODE=1 -$python -c 'from numpy import _pytesttester as ptt; ptt._show_numpy_info()' -testcall="pytest-%{$python_bin_suffix} -n auto -c ../pytest.ini %{buildroot}%{$python_sitearch}/numpy" -[ -n "$test_failok" ] && ${testcall} -k "${test_failok:4}" || true -${testcall} ${test_failok:+-k "not (${test_failok:4})"} -rm -Rf %{buildroot}%{$python_sitearch}/numpy/.pytest_cache +[ -n "$test_failok" ] && $python runobstest.py "${test_failok:4}" ||: +$python runobstest.py "not (${test_failok:4})" } + popd %endif