diff --git a/.gitignore b/.gitignore index 9d4b94f..1bddd93 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ numpy-1.4.1.tar.gz /numpy-1.6.1.tar.gz /numpy-1.6.2rc1.tar.gz /numpy-1.6.2.tar.gz +/numpy-1.7.0b1.tar.gz diff --git a/001-fix-test_multiarray.patch b/001-fix-test_multiarray.patch index 817643c..456119b 100644 --- a/001-fix-test_multiarray.patch +++ b/001-fix-test_multiarray.patch @@ -1,9 +1,9 @@ -diff -up numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray numpy-1.6.2/numpy/core/tests/test_multiarray.py ---- numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray 2012-05-19 09:51:54.000000000 -0400 -+++ numpy-1.6.2/numpy/core/tests/test_multiarray.py 2012-08-05 09:36:17.138719006 -0400 -@@ -13,6 +13,15 @@ from numpy.compat import asbytes, getexc +diff -up numpy-1.7.0b1/numpy/core/tests/test_multiarray.py.orig numpy-1.7.0b1/numpy/core/tests/test_multiarray.py +--- numpy-1.7.0b1/numpy/core/tests/test_multiarray.py.orig 2012-08-12 21:53:17.000000000 -0600 ++++ numpy-1.7.0b1/numpy/core/tests/test_multiarray.py 2012-08-21 16:36:35.123297576 -0600 +@@ -23,6 +23,15 @@ from numpy.testing import ( + from datetime import timedelta - from test_print import in_foreign_locale +if sys.version_info[:2] > (3, 2): + # In Python 3.3 the representation of empty shape, strides and suboffsets @@ -17,7 +17,7 @@ diff -up numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray numpy-1 class TestFlags(TestCase): def setUp(self): self.a = arange(10) -@@ -2162,7 +2171,7 @@ if sys.version_info >= (2, 6): +@@ -2640,7 +2649,7 @@ if sys.version_info >= (2, 6): assert_equal(y.shape, (5,)) assert_equal(y.ndim, 1) assert_equal(y.strides, (4,)) @@ -26,7 +26,7 @@ diff -up numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray numpy-1 assert_equal(y.itemsize, 4) def test_export_simple_nd(self): -@@ -2172,7 +2181,7 @@ if sys.version_info >= (2, 6): +@@ -2650,7 +2659,7 @@ if sys.version_info >= (2, 6): assert_equal(y.shape, (2, 2)) assert_equal(y.ndim, 2) assert_equal(y.strides, (16, 8)) @@ -35,7 +35,7 @@ diff -up numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray numpy-1 assert_equal(y.itemsize, 8) def test_export_discontiguous(self): -@@ -2182,7 +2191,7 @@ if sys.version_info >= (2, 6): +@@ -2660,7 +2669,7 @@ if sys.version_info >= (2, 6): assert_equal(y.shape, (3, 3)) assert_equal(y.ndim, 2) assert_equal(y.strides, (36, 4)) @@ -44,7 +44,7 @@ diff -up numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray numpy-1 assert_equal(y.itemsize, 4) def test_export_record(self): -@@ -2214,7 +2223,7 @@ if sys.version_info >= (2, 6): +@@ -2693,7 +2702,7 @@ if sys.version_info >= (2, 6): y = memoryview(x) assert_equal(y.shape, (1,)) assert_equal(y.ndim, 1) @@ -53,7 +53,7 @@ diff -up numpy-1.6.2/numpy/core/tests/test_multiarray.py.test_multiarray numpy-1 sz = sum([dtype(b).itemsize for a, b in dt]) if dtype('l').itemsize == 4: -@@ -2228,10 +2237,10 @@ if sys.version_info >= (2, 6): +@@ -2707,10 +2716,10 @@ if sys.version_info >= (2, 6): x = np.array(([[1,2],[3,4]],), dtype=[('a', ('i', (2,2)))]) y = memoryview(x) assert_equal(y.format, 'T{(2,2)i:a:}') diff --git a/002-fix_PyUnicodeObject.patch b/002-fix_PyUnicodeObject.patch index 57b31ba..2202ceb 100644 --- a/002-fix_PyUnicodeObject.patch +++ b/002-fix_PyUnicodeObject.patch @@ -1,30 +1,24 @@ -diff -up numpy-1.6.2/numpy/core/src/multiarray/scalarapi.c.fix_PyUnicodeObject numpy-1.6.2/numpy/core/src/multiarray/scalarapi.c ---- numpy-1.6.2/numpy/core/src/multiarray/scalarapi.c.fix_PyUnicodeObject 2012-05-19 09:51:54.000000000 -0400 -+++ numpy-1.6.2/numpy/core/src/multiarray/scalarapi.c 2012-08-05 16:07:29.956719007 -0400 -@@ -652,6 +652,40 @@ PyArray_Scalar(void *data, PyArray_Descr +--- numpy-1.7.0b1/numpy/core/src/multiarray/scalarapi.c 2012-08-12 21:53:17.000000000 -0600 ++++ numpy/numpy/core/src/multiarray/scalarapi.c 2012-08-21 16:34:29.864303392 -0600 +@@ -641,6 +641,35 @@ PyArray_Scalar(void *data, PyArray_Descr itemsize = (((itemsize - 1) >> 2) + 1) << 2; } } +#if PY_VERSION_HEX >= 0x03030000 + if (type_num == NPY_UNICODE) { + PyObject *u, *args; -+ char *buffer; -+ if (swap) { -+ buffer = malloc(itemsize); -+ if (buffer == NULL) { -+ PyErr_NoMemory(); -+ return NULL; -+ } -+ memcpy(buffer, data, itemsize); -+ byte_swap_vector(buffer, itemsize >> 2, 4); -+ } else { -+ buffer = data; -+ } -+ u = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, buffer, -+ itemsize >> 2); -+ if (swap) { -+ free(buffer); -+ } ++ int byteorder; ++ ++#if NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN ++ byteorder = -1; ++#elif NPY_BYTE_ORDER == NPY_BIG_ENDIAN ++ byteorder = +1; ++#else ++ #error Endianness undefined ? ++#endif ++ if (swap) byteorder *= -1; ++ ++ u = PyUnicode_DecodeUTF32(data, itemsize, NULL, &byteorder); + if (u == NULL) { + return NULL; + } @@ -42,19 +36,19 @@ diff -up numpy-1.6.2/numpy/core/src/multiarray/scalarapi.c.fix_PyUnicodeObject n if (type->tp_itemsize != 0) { /* String type */ obj = type->tp_alloc(type, itemsize); -@@ -688,6 +722,7 @@ PyArray_Scalar(void *data, PyArray_Descr +@@ -672,6 +701,7 @@ PyArray_Scalar(void *data, PyArray_Descr memcpy(destptr, data, itemsize); return obj; } +#if PY_VERSION_HEX < 0x03030000 - else if (type_num == PyArray_UNICODE) { + else if (type_num == NPY_UNICODE) { /* tp_alloc inherited from Python PyBaseObject_Type */ PyUnicodeObject *uni = (PyUnicodeObject*)obj; -@@ -759,6 +794,7 @@ PyArray_Scalar(void *data, PyArray_Descr +@@ -743,6 +773,7 @@ PyArray_Scalar(void *data, PyArray_Descr #endif return obj; } -+#endif // PY_VERSION_HEX < 0x03030000 ++#endif /* PY_VERSION_HEX < 0x03030000 */ else { PyVoidScalarObject *vobj = (PyVoidScalarObject *)obj; vobj->base = NULL; diff --git a/09d2c51fa1d09b17060a8545b925f4dded9dedb1.patch b/09d2c51fa1d09b17060a8545b925f4dded9dedb1.patch deleted file mode 100644 index a242079..0000000 --- a/09d2c51fa1d09b17060a8545b925f4dded9dedb1.patch +++ /dev/null @@ -1,37 +0,0 @@ -commit 09d2c51fa1d09b17060a8545b925f4dded9dedb1 -Author: Ondrej Certik -Date: Fri Aug 3 09:36:46 2012 -0700 - - Follow the C guidelines - -diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c -index 0afdc17..97a5e4b 100644 ---- a/numpy/core/src/multiarray/scalarapi.c -+++ b/numpy/core/src/multiarray/scalarapi.c -@@ -645,6 +645,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) - if (type_num == NPY_UNICODE) { - PyObject *u, *args; - char *buffer; -+ - if (swap) { - buffer = malloc(itemsize); - if (buffer == NULL) { -@@ -653,7 +654,8 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) - } - memcpy(buffer, data, itemsize); - byte_swap_vector(buffer, itemsize >> 2, 4); -- } else { -+ } -+ else { - buffer = data; - } - u = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, buffer, -@@ -778,7 +780,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) - #endif - return obj; - } --#endif // PY_VERSION_HEX < 0x03030000 -+#endif /* PY_VERSION_HEX < 0x03030000 */ - else { - PyVoidScalarObject *vobj = (PyVoidScalarObject *)obj; - vobj->base = NULL; diff --git a/f2ac38f09ff258339ef44572a3abba02019e1f55.patch b/f2ac38f09ff258339ef44572a3abba02019e1f55.patch deleted file mode 100644 index 124ccb7..0000000 --- a/f2ac38f09ff258339ef44572a3abba02019e1f55.patch +++ /dev/null @@ -1,50 +0,0 @@ -commit f2ac38f09ff258339ef44572a3abba02019e1f55 -Author: Ondrej Certik -Date: Fri Aug 3 10:39:25 2012 -0700 - - Use PyUnicode_DecodeUTF32() - - This function handles the swapping automatically and it returns a unicode - object in one of: UCS1, UCS2 or UCS4 internal Python format. - -diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c -index 97a5e4b..d9bc492 100644 ---- a/numpy/core/src/multiarray/scalarapi.c -+++ b/numpy/core/src/multiarray/scalarapi.c -@@ -644,25 +644,18 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base) - #if PY_VERSION_HEX >= 0x03030000 - if (type_num == NPY_UNICODE) { - PyObject *u, *args; -- char *buffer; -+ int byteorder; - -- if (swap) { -- buffer = malloc(itemsize); -- if (buffer == NULL) { -- PyErr_NoMemory(); -- return NULL; -- } -- memcpy(buffer, data, itemsize); -- byte_swap_vector(buffer, itemsize >> 2, 4); -- } -- else { -- buffer = data; -- } -- u = PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, buffer, -- itemsize >> 2); -- if (swap) { -- free(buffer); -- } -+#if NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN -+ byteorder = -1; -+#elif NPY_BYTE_ORDER == NPY_BIG_ENDIAN -+ byteorder = +1; -+#else -+ #error Endianness undefined ? -+#endif -+ if (swap) byteorder *= -1; -+ -+ u = PyUnicode_DecodeUTF32(data, itemsize, NULL, &byteorder); - if (u == NULL) { - return NULL; - } diff --git a/numpy.spec b/numpy.spec index fe1414f..3761c35 100644 --- a/numpy.spec +++ b/numpy.spec @@ -5,11 +5,11 @@ %endif #uncomment next line for a release candidate or a beta -%global relc %{nil} +%global relc b1 Name: numpy -Version: 1.6.2 -Release: 5%{?dist} +Version: 1.7.0 +Release: 0.1.%{relc}%{?dist} Epoch: 1 Summary: A fast multidimensional array facility for Python @@ -34,14 +34,6 @@ Patch2: 002-fix_PyUnicodeObject.patch # "FIX: Make sure the tests produce valid unicode" # copy of upstream commit 4234b6b13e3ee9da6fc1c24e9e8c442d77587837: Patch3: 4234b6b13e3ee9da6fc1c24e9e8c442d77587837.patch -# -# "Follow the C guidelines" -# copy of upstream commit 09d2c51fa1d09b17060a8545b925f4dded9dedb1: -Patch4: 09d2c51fa1d09b17060a8545b925f4dded9dedb1.patch -# -# "Use PyUnicode_DecodeUTF32()" -# copy of upstream commit f2ac38f09ff258339ef44572a3abba02019e1f55: -Patch5: f2ac38f09ff258339ef44572a3abba02019e1f55.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -112,8 +104,6 @@ This package includes a version of f2py that works properly with NumPy. %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 -%patch5 -p1 # Regenerate Cython c sources # This is needed with numpy-1.6.2.tar.gz with python 3.3 to avoid an exception @@ -292,6 +282,11 @@ rm -rf %{buildroot} %changelog +* Tue Aug 21 2012 Orion Poplawski - 1:1.7.0-0.1.b1 +- Update to 1.7.0b1 +- Rebase python 3.3 patchs to current git master +- Drop patches applied upstream + * Sun Aug 5 2012 David Malcolm - 1:1.6.2-5 - rework patches for 3.3 to more directly reflect upstream's commits - re-enable test suite on python 3 diff --git a/sources b/sources index 559d8d1..741091b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -95ed6c9dcc94af1fc1642ea2a33c1bba numpy-1.6.2.tar.gz +361da69031556e8f1a99a021162c7040 numpy-1.7.0b1.tar.gz