The package rpms/scipy.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/scipy.git/commit/?id=33f8ec88d1bd...
https://src.fedoraproject.org/cgit/rpms/scipy.git/commit/?id=2b99813d5486....
Change:
-%ifarch %{openblas_arches}
+%ifarch ppc64le
Thanks.
Full change:
============
commit 2b99813d5486e9cc04904c1857b1ac68e5c492e3
Author: Miro Hrončok <miro(a)hroncok.cz>
Date: Sat Jun 23 23:00:13 2018 +0200
Don't ignore the tests results but rather have a tolerance rate
Historically, we ignored the test results as we don't have the
manpower to investigate the failures on various architectures.
Since most of the test pass, I've added a 1% failure tolerance
on everything except x86_64, so we do no longer need to ignore the
results. This makes it easier to spat that it's no longer a couple
test that fails on some random architecture but rather a more
severe problem.
In the process I had to disable test_decomp on ppc64le, because it
segfaults.
diff --git a/acceptable_failure_rate.patch b/acceptable_failure_rate.patch
new file mode 100644
index 0000000..6ae4bca
--- /dev/null
+++ b/acceptable_failure_rate.patch
@@ -0,0 +1,28 @@
+diff --git a/scipy/conftest.py b/scipy/conftest.py
+index b0edcdd..f5c3c0b 100644
+--- a/scipy/conftest.py
++++ b/scipy/conftest.py
+@@ -3,6 +3,7 @@ from __future__ import division, absolute_import, print_function
+
+ import os
+ import pytest
++import _pytest
+ import warnings
+
+ from scipy._lib._fpumode import get_fpu_mode
+@@ -33,3 +34,15 @@ def check_fpu_mode(request):
+ warnings.warn("FPU mode changed from {0:#x} to {1:#x} during "
+ "the test".format(old_mode, new_mode),
+ category=FPUModeChangeWarning, stacklevel=0)
++
++
++ACCEPTABLE_FAILURE_RATE = int(os.environ.get('ACCEPTABLE_FAILURE_RATE', 0))
++
++
++(a)pytest.hookimpl()
++def pytest_sessionfinish(session, exitstatus):
++ if exitstatus != _pytest.main.EXIT_TESTSFAILED:
++ return
++ failure_rate = (100.0 * session.testsfailed) / session.testscollected
++ if failure_rate <= ACCEPTABLE_FAILURE_RATE:
++ session.exitstatus = 0
diff --git a/scipy.spec b/scipy.spec
index e8950a2..503a5a7 100644
--- a/scipy.spec
+++ b/scipy.spec
@@ -7,7 +7,7 @@
Summary: Scientific Tools for Python
Name: scipy
Version: 1.1.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Group: Development/Libraries
# BSD -- whole package except:
@@ -17,6 +17,11 @@ License: BSD and Boost and Public Domain
Url:
http://www.scipy.org/scipylib/index.html
Source0:
https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{vers...
+# Previously we ignored the tests results, because they don't always pass
+# Instead of ignoring the results entirely, we allow certain failure rate
+#
https://stackoverflow.com/a/47731333/1839451
+Patch0: acceptable_failure_rate.patch
+
BuildRequires: python2-numpy, python2-devel,python2-numpy-f2py
BuildRequires: python2-pytest
BuildRequires: python2-pytest-xdist
@@ -109,7 +114,7 @@ leading scientists and engineers.
%prep
-%setup -q -n %{name}-%{version}%{?rcver}
+%autosetup -p1 -n %{name}-%{version}%{?rcver}
cat > site.cfg << EOF
[amd]
@@ -164,18 +169,35 @@ done
%check
# Skip all tests on s390x because they hangs unexpectedly and randomly
# and pytest-timeout has no effect. Note that the outcome of the tests
-# is ignored anyway so by disabling the test for s390x we are not doing
-# anything more dangerous.
-%ifnarch s390x
+# was previously ignored anyway so by disabling the test for s390x we
+# are not doing anything more dangerous.
+%ifarch s390x
+exit 0
+%endif
+
+%ifarch x86_64
+export ACCEPTABLE_FAILURE_RATE=0
+%else
+# there are usually 10-21 test failing, so we allow 1% failure rate
+export ACCEPTABLE_FAILURE_RATE=1
+%endif
+
+%ifarch ppc64le
+# test_decomp segfaults on ppc64le
+export k="not test_denormals and not test_decomp"
+%else
+# test_denormals tends to stuck
+export k="not test_denormals"
+%endif
+
pushd %{buildroot}/%{python3_sitearch}
-py.test-%{python3_version} --timeout=300 -k "not test_denormals" scipy || :
+py.test-3 --timeout=300 -k "$k" scipy
popd
pushd %{buildroot}/%{python2_sitearch}
-py.test-%{python2_version} --timeout=300 -k "not test_denormals" scipy || :
+py.test-2 --timeout=300 -k "$k" scipy
popd
-%endif # ifnarch s390x
%files -n python2-scipy
%doc LICENSE.txt
@@ -200,6 +222,10 @@ popd
%endif # with doc
%changelog
+* Sat Jun 23 2018 Miro Hrončok <mhroncok(a)redhat.com> - 1.1.0-2
+- Don't ignore the tests results but rather have a tolerance rate
+- Skip test_decomp on ppc64le as it currently segfaults
+
* Fri Jun 22 2018 Miro Hrončok <mhroncok(a)redhat.com> - 1.1.0-1
- Update to 1.1.0 (#1560265, #1594355)
commit 33f8ec88d1bd38c4783496ea6ada9def089a1981
Author: Miro Hrončok <miro(a)hroncok.cz>
Date: Sat Jun 23 10:10:51 2018 +0200
Only build scipy once (per Python)
The build_sphinx setup.py command previously used to build the docs
calls build_ext --inplace internally. That's one build.
Later the install command was called and that calls build as well.
Inplace and non-inplace builds happen separately.
By first explicitly building with build and then invoking sphinx
trough the Makefile, we can use install --skip-build (%pyX_install).
Explicit call to sphinx also removes the need to remove conf.py
from bundled projects.
This also saves us setting the build flags in %install, which was
previously only needed because of the build happening there.
While doing this, I've also switched the build section to build for
for Python 3 and Python 2 in a loop to make the specfile DRY.
diff --git a/scipy.spec b/scipy.spec
index 5ddfdba..e8950a2 100644
--- a/scipy.spec
+++ b/scipy.spec
@@ -129,73 +129,37 @@ openblas_libs = openblasp
%endif
EOF
-# sphinx_build somehow randomly decides which docs to build here
-# there is: doc/source/conf.py - scipy docs - we want that one
-# doc/sphinxext/doc/conf.py - bundled numpydoc documentation
-# doc/scipy-sphinx-theme/conf.py - testing documentation for the theme
-rm doc/sphinxext -r # contains only bundled numpydoc
-rm doc/scipy-sphinx-theme/conf.py
+# remove bundled numpydoc
+rm doc/sphinxext -r
%build
-env CFLAGS="$RPM_OPT_FLAGS -lm" \
- FFLAGS="$RPM_OPT_FLAGS -fPIC" \
-%ifarch %{openblas_arches}
- OPENBLAS=%{_libdir} \
-%else
- ATLAS=%{_libdir}/atlas \
-%endif
- FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} \
- %__python3 setup.py config_fc \
- --fcompiler=gnu95 --noarch \
-%if %{with doc}
- build_sphinx
- rm -r build/sphinx/html/.buildinfo
- mv build/sphinx build/sphinx-%{python3_version}
-%else
- build
-%endif # with doc
-
-env CFLAGS="$RPM_OPT_FLAGS" \
- FFLAGS="$RPM_OPT_FLAGS -fPIC" \
-%ifarch %{openblas_arches}
+for PY in %{python3_version} %{python2_version}; do
+ env CFLAGS="$RPM_OPT_FLAGS -lm" \
+ FFLAGS="$RPM_OPT_FLAGS -fPIC" \
+ %ifarch %{openblas_arches}
OPENBLAS=%{_libdir} \
-%else
+ %else
ATLAS=%{_libdir}/atlas \
-%endif
+ %endif
FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} \
- %__python2 setup.py config_fc \
+ %{_bindir}/python$PY setup.py config_fc \
--fcompiler=gnu95 --noarch \
-%if %{with doc}
- build_sphinx
- rm -r build/sphinx/html/.buildinfo
- mv build/sphinx build/sphinx-%{python2_version}
-%else
build
-%endif # with doc
+ %if %{with doc}
+ pushd doc
+ export PYTHONPATH=$(echo ../build/lib.linux-*-$PY/)
+ make html SPHINXBUILD=sphinx-build-$PY
+ rm -rf build/html/.buildinfo
+ mv build build-$PY
+ popd
+ %endif
+done
%install
-env CFLAGS="$RPM_OPT_FLAGS -lm" \
- FFLAGS="$RPM_OPT_FLAGS -fPIC" \
-%ifarch %{openblas_arches}
- OPENBLAS=%{_libdir} \
-%else
- ATLAS=%{_libdir}/atlas \
-%endif
- FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} \
- %__python3 setup.py install --root=%{buildroot}
-
-env CFLAGS="$RPM_OPT_FLAGS" \
- FFLAGS="$RPM_OPT_FLAGS -fPIC" \
-%ifarch %{openblas_arches}
- OPENBLAS=%{_libdir} \
-%else
- ATLAS=%{_libdir}/atlas \
-%endif
- FFTW=%{_libdir} BLAS=%{_libdir} LAPACK=%{_libdir} \
- %__python2 setup.py install --root=%{buildroot}
-
+%py3_install
+%py2_install
%check
# Skip all tests on s390x because they hangs unexpectedly and randomly
@@ -221,7 +185,7 @@ popd
%if %{with doc}
%files -n python2-scipy-doc
%license LICENSE.txt
-%doc build/sphinx-%{python2_version}/html
+%doc doc/build-%{python2_version}/html
%endif # with doc
%files -n python3-scipy
@@ -232,7 +196,7 @@ popd
%if %{with doc}
%files -n python3-scipy-doc
%license LICENSE.txt
-%doc build/sphinx-%{python3_version}/html
+%doc doc/build-%{python3_version}/html
%endif # with doc
%changelog