SHA256
1
0
forked from pool/python-numpy

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
This commit is contained in:
2021-12-09 22:23:44 +00:00
committed by Git OBS Bridge
parent ad46d677c9
commit a7ec7495ab
2 changed files with 25 additions and 7 deletions

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Dec 9 14:43:32 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Ignore Python 3.10 deprecation warnings
-------------------------------------------------------------------
Sun Dec 5 07:26:13 UTC 2021 - Matej Cepl <mcepl@suse.com>

View File

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