[Python-modules-commits] r27167 - in packages/numpy/trunk/debian (11 files)
jtaylor-guest at users.alioth.debian.org
jtaylor-guest at users.alioth.debian.org
Sat Jan 11 18:32:00 UTC 2014
Date: Saturday, January 11, 2014 @ 18:31:59
Author: jtaylor-guest
Revision: 27167
add autopkgtests running testsuite with different BLAS and testing f2py and distutils (Closes: #695881)
Added:
packages/numpy/trunk/debian/tests/
packages/numpy/trunk/debian/tests/atlas
packages/numpy/trunk/debian/tests/capi
packages/numpy/trunk/debian/tests/control
packages/numpy/trunk/debian/tests/distutils
packages/numpy/trunk/debian/tests/f2py
packages/numpy/trunk/debian/tests/openblas
packages/numpy/trunk/debian/tests/python2
packages/numpy/trunk/debian/tests/python3
Modified:
packages/numpy/trunk/debian/changelog
packages/numpy/trunk/debian/control
Modified: packages/numpy/trunk/debian/changelog
===================================================================
--- packages/numpy/trunk/debian/changelog 2014-01-11 17:08:01 UTC (rev 27166)
+++ packages/numpy/trunk/debian/changelog 2014-01-11 18:31:59 UTC (rev 27167)
@@ -1,3 +1,10 @@
+python-numpy (1:1.8.0-2) experimental; urgency=low
+
+ * add autopkgtests running testsuite with different BLAS and testing f2py
+ and distutils (Closes: #695881)
+
+ -- Julian Taylor <jtaylor.debian at googlemail.com> Sat, 11 Jan 2014 18:39:03 +0100
+
python-numpy (1:1.8.0-1) experimental; urgency=low
* New upstream release; Closes: #724047, #701920, #710177
Modified: packages/numpy/trunk/debian/control
===================================================================
--- packages/numpy/trunk/debian/control 2014-01-11 17:08:01 UTC (rev 27166)
+++ packages/numpy/trunk/debian/control 2014-01-11 18:31:59 UTC (rev 27167)
@@ -10,6 +10,7 @@
Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/numpy/trunk/
Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/numpy/trunk/
Homepage: http://www.numpy.org/
+XS-Testsuite: autopkgtest
Package: python-numpy
Architecture: any
Added: packages/numpy/trunk/debian/tests/atlas
===================================================================
--- packages/numpy/trunk/debian/tests/atlas (rev 0)
+++ packages/numpy/trunk/debian/tests/atlas 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -efu
+blaslib=$(update-alternatives --list libblas.so.3 | grep $(basename $0))
+update-alternatives --set libblas.so.3 $blaslib
+
+# one python is enough
+PYS=${PYS:-"$(pyversions -d 2>/dev/null)"}
+
+#test only modules that link against libblas
+PYS=$PYS TESTPKG=numpy.core debian/tests/python2
+PYS=$PYS TESTPKG=numpy.linalg debian/tests/python2
Property changes on: packages/numpy/trunk/debian/tests/atlas
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/numpy/trunk/debian/tests/capi
===================================================================
--- packages/numpy/trunk/debian/tests/capi (rev 0)
+++ packages/numpy/trunk/debian/tests/capi 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,91 @@
+#!/bin/sh
+set -efu
+
+PYS=$(pyversions -r 2>/dev/null)" "$(py3versions -r 2>/dev/null)
+
+cd "$ADTTMP"
+
+cat << EOF > setup.py
+def configuration(parent_package='', top_path=None):
+ from numpy.distutils.misc_util import Configuration
+
+ config = Configuration('npufunc_directory', parent_package, top_path)
+ config.add_extension('npufunc', ['ufunc.c'])
+
+ return config
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(configuration=configuration)
+EOF
+
+
+cat << EOF > ufunc.c
+#include "Python.h"
+#include "numpy/ndarraytypes.h"
+#include "numpy/ufuncobject.h"
+
+static PyMethodDef LogitMethods[] = {
+ {NULL, NULL, 0, NULL}
+};
+
+static void double_logit(char **args, npy_intp *dimensions,
+ npy_intp* steps, void* data)
+{
+}
+
+PyUFuncGenericFunction funcs[1] = {&double_logit};
+static char types[4] = {NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE};
+static void *data[1] = {NULL};
+
+static void setupmodule(PyObject * m)
+{
+ PyObject * logit, * d;
+ import_array();
+ import_umath();
+ logit = PyUFunc_FromFuncAndData(funcs, data, types, 4, 3, 1,
+ PyUFunc_Zero, "logit",
+ "logit_docstring", 0);
+ d = PyModule_GetDict(m);
+ PyDict_SetItemString(d, "logit", logit);
+ Py_DECREF(logit);
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "npufunc", NULL, -1,
+ LogitMethods, NULL, NULL, NULL, NULL
+};
+
+PyMODINIT_FUNC PyInit_npufunc(void)
+{
+ PyObject * m = PyModule_Create(&moduledef);
+ if (m == NULL) {
+ return;
+ }
+ setupmodule(m);
+ return m;
+}
+#else
+PyMODINIT_FUNC initnpufunc(void)
+{
+ PyObject *m = Py_InitModule("npufunc", LogitMethods);
+ if (m == NULL) {
+ return;
+ }
+ setupmodule(m);
+}
+#endif
+EOF
+
+for py in $PYS; do
+ echo "=== $py ==="
+ $py setup.py build 2>&1
+ $py-dbg setup.py build 2>&1
+ $py setup.py install --prefix $PWD/inst 2>&1
+ $py-dbg setup.py install --prefix $PWD/inst 2>&1
+ export PYTHONPATH=$PWD/inst/lib/$py/site-packages/npufunc_directory
+ $py -c "import npufunc; print(npufunc.logit(1,2,3))" 2>&1
+ $py-dbg -c "import npufunc; print(npufunc.logit(1,2,3))" 2>&1
+done
Property changes on: packages/numpy/trunk/debian/tests/capi
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/numpy/trunk/debian/tests/control
===================================================================
--- packages/numpy/trunk/debian/tests/control (rev 0)
+++ packages/numpy/trunk/debian/tests/control 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,24 @@
+Tests: python2
+Depends: python-numpy, python-all, python-nose, python-tz
+
+Tests: python3
+Depends: python3-numpy, python3-all, python3-nose, python3-tz
+
+#needs root for update-alternatives
+Tests: openblas
+Restrictions: needs-root
+Depends: python-numpy, python-all, python-nose, python-tz, libopenblas-base
+
+#needs root for update-alternatives
+Tests: atlas
+Restrictions: needs-root
+Depends: python-numpy, python-all, python-nose, python-tz, libatlas3-base
+
+Tests: f2py
+Depends: gcc, gfortran, python-numpy, python-numpy-dbg, python-all, python-all-dbg, python-all-dev, python3-numpy, python3-numpy-dbg, python3-all, python3-all-dbg, python3-all-dev
+
+Tests: distutils
+Depends: gcc, libfftw3-dev, python-numpy
+
+Tests: capi
+Depends: gcc, python-all-dev, python-all-dbg, python3-all-dev, python3-all-dbg, python-numpy, python-numpy-dbg, python3-numpy, python3-numpy-dbg
Added: packages/numpy/trunk/debian/tests/distutils
===================================================================
--- packages/numpy/trunk/debian/tests/distutils (rev 0)
+++ packages/numpy/trunk/debian/tests/distutils 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -efu
+
+PYS=$(pyversions -r 2>/dev/null)
+
+cd "$ADTTMP"
+
+for py in $PYS; do
+ # check distutils copes with multi arch
+ $py -c 'from numpy.distutils.system_info import get_info; get_info("fftw3", 2)'
+done
Property changes on: packages/numpy/trunk/debian/tests/distutils
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/numpy/trunk/debian/tests/f2py
===================================================================
--- packages/numpy/trunk/debian/tests/f2py (rev 0)
+++ packages/numpy/trunk/debian/tests/f2py 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -efu
+
+PYS=$(pyversions -rv 2>/dev/null)" "$(py3versions -rv 2>/dev/null)
+
+cd "$ADTTMP"
+
+cat << EOF > hello.f
+C File hello.f
+ integer function foo (a)
+ integer a
+ foo = a + 1
+ end
+EOF
+
+for py in " " 3 $PYS; do
+ [ "$py" = " " ] && py=""
+ echo "=== f2py$py ==="
+ f2py$py -c -m hello hello.f 2>&1
+ python$py -c 'import hello; assert hello.foo(4) == 5'
+ f2py$py-dbg -c -m hello hello.f 2>&1
+ python$py-dbg -c 'import hello; assert hello.foo(4) == 5' 2>&1
+done
Property changes on: packages/numpy/trunk/debian/tests/f2py
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/numpy/trunk/debian/tests/openblas
===================================================================
--- packages/numpy/trunk/debian/tests/openblas (rev 0)
+++ packages/numpy/trunk/debian/tests/openblas 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -efu
+blaslib=$(update-alternatives --list libblas.so.3 | grep $(basename $0))
+update-alternatives --set libblas.so.3 $blaslib
+
+# one python is enough
+PYS=${PYS:-"$(pyversions -d 2>/dev/null)"}
+
+#test only modules that link against libblas
+PYS=$PYS TESTPKG=numpy.core debian/tests/python2
+PYS=$PYS TESTPKG=numpy.linalg debian/tests/python2
Property changes on: packages/numpy/trunk/debian/tests/openblas
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/numpy/trunk/debian/tests/python2
===================================================================
--- packages/numpy/trunk/debian/tests/python2 (rev 0)
+++ packages/numpy/trunk/debian/tests/python2 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -efu
+
+PYS=${PYS:-"$(pyversions -r 2>/dev/null)"}
+TESTPKG=${TESTPKG:-numpy}
+
+cd "$ADTTMP"
+
+for py in $PYS; do
+ echo "=== $py ==="
+ $py -c "import $TESTPKG; $TESTPKG.test(verbose=2)" 2>&1
+done
Property changes on: packages/numpy/trunk/debian/tests/python2
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/numpy/trunk/debian/tests/python3
===================================================================
--- packages/numpy/trunk/debian/tests/python3 (rev 0)
+++ packages/numpy/trunk/debian/tests/python3 2014-01-11 18:31:59 UTC (rev 27167)
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -efu
+
+PYS=${PYS:-"$(py3versions -r 2>/dev/null)"}
+TESTPKG=${TESTPKG:-numpy}
+
+cd "$ADTTMP"
+
+for py in $PYS; do
+ echo "=== $py ==="
+ $py -c "import $TESTPKG; $TESTPKG.test(verbose=2)" 2>&1
+done
Property changes on: packages/numpy/trunk/debian/tests/python3
___________________________________________________________________
Added: svn:executable
+ *
More information about the Python-modules-commits
mailing list