Add upstream patch to fix ctypes test

This commit is contained in:
Thomas Spura 2015-11-14 13:05:41 +01:00
parent d8479b3994
commit f7432686a4
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,26 @@
commit 1f5ccd5447ed2796bb8e9506cfbfdb4a82cccfc0
Author: Ralf Gommers <ralf.gommers@gmail.com>
Date: Sat Oct 24 18:17:04 2015 +0200
TST: fix issue with a ctypes test for integrate on Fedora. Closes gh-5370
diff --git a/scipy/integrate/tests/test_quadpack.py b/scipy/integrate/tests/test_quadpack.py
index c3a417c..f384c77 100644
--- a/scipy/integrate/tests/test_quadpack.py
+++ b/scipy/integrate/tests/test_quadpack.py
@@ -42,7 +42,14 @@ class TestCtypesQuad(TestCase):
file = 'libm.dylib'
else:
file = 'libm.so'
- self.lib = ctypes.CDLL(file)
+
+ try:
+ self.lib = ctypes.CDLL(file)
+ except OSError:
+ # This test doesn't work on some Linux platforms (Fedora for
+ # example) that put an ld script in libm.so - see gh-5370
+ self.skipTest("Ctypes can't import libm.so")
+
restype = ctypes.c_double
argtypes = (ctypes.c_double,)
for name in ['sin', 'cos', 'tan']:

View File

@ -20,6 +20,7 @@ Group: Development/Libraries
License: BSD and Boost and Public Domain License: BSD and Boost and Public Domain
Url: http://www.scipy.org Url: http://www.scipy.org
Source0: http://downloads.sourceforge.net/scipy/%{name}-%{version}%{?rcver}.tar.gz Source0: http://downloads.sourceforge.net/scipy/%{name}-%{version}%{?rcver}.tar.gz
Patch0: scipy-0.16.1-ctyptes-test.patch
BuildRequires: numpy, python2-devel,f2py BuildRequires: numpy, python2-devel,f2py
BuildRequires: fftw-devel, blas-devel, lapack-devel, suitesparse-devel BuildRequires: fftw-devel, blas-devel, lapack-devel, suitesparse-devel
@ -99,6 +100,8 @@ include_dirs = /usr/include/suitesparse
umfpack_libs = umfpack umfpack_libs = umfpack
EOF EOF
%patch0 -p1
%build %build
%if 0%{?with_python3} %if 0%{?with_python3}
@ -158,6 +161,9 @@ PYTHONPATH=$RPM_BUILD_ROOT%{python2_sitearch} \
%endif # with_python3 %endif # with_python3
%changelog %changelog
* Sat Nov 14 2015 Thomas Spura <tomspur@fedoraproject.org> - 0.16.1-3
- Add patch to fix ctypes test
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16.1-2 * Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16.1-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5