Summary: | dev-python/cython fails tests with >=dev-python/numpy-1.5 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Theo Chatzimichos (RETIRED) <tampakrap> |
Component: | New packages | Assignee: | Python Gentoo Team <python> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | DuPol, kingjon3377, levertond |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=365579 https://bugs.gentoo.org/show_bug.cgi?id=393679 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log 0.14-r1
update cython ebuild updated ebuild the build log |
Description
Theo Chatzimichos (RETIRED)
![]() ![]() ![]() Created attachment 259369 [details]
build.log 0.14-r1
It's a known problem occuring only when >=dev-python/numpy-1.5 is installed: http://trac.cython.org/cython_trac/ticket/630 Created attachment 266661 [details]
update cython ebuild
Adds a dependency blocker for the versions of numpy that upstream states are unsupported.
Created attachment 266665 [details]
updated ebuild
Upload the correct file
Comment on attachment 266665 [details]
updated ebuild
It doesn't make sense to block new NumPy.
> It doesn't make sense to block new NumPy.
In the opinion of the upstream developers this version of Cython (and earlier versions of Cython) does not work with NumPy version 1.5 or newer and Cython code needs to be fixed before Cython is compatible. Thus NumPy version 1.5 or later cannot be installed if Cython is install. This is why the package block concept exists. You must choose one or the other otherwise packages fail. Fix the problem with a block until there is a code fix.
NumPy 1.5 has introduced support for Python 3 and many other fixes (including fix for building on ppc and ppc64), so blocking it is unacceptable. Older versions of NumPy will be removed after stabilization of NumPy 1.5.*. If anyone else is looking for Cython's take on this - they believe it's a bug in NumPy (took me a little while to find it as their trac ticket doesn't hyperlink to the commit...): https://github.com/cython/cython/commit/fcd59a76dd679feda9c24c75cf21c78ea4a0cbb7 however that commit doesn't apply to cython 1.14.1 so we'll just have to wait. FWIW: I just ran the python 0.15 test suite against bumpy 1.5.1 on AMD64. These tests pass on python 2.4,2.5,2.6 and 2.7 an update on this. after repeating the test phase many times, it seems that currently; cython test phases passes for python2* for numpy 1.5.1 cython test phase fails only against python3.2 for numpy 1.5.1 cython test phase fails on every CPython for numpy 1.6.0 up. Now the failures for the former are; File "/usr/lib64/python3.2/distutils/unixccompiler.py", line 181, in _compile seemingly repeated 4 times, but looks like just the 1. Just the 1 little error. Now, testing against numpy 1.6.0 up yields a curious outcome. File "/mnt/gen2/tmpdir/portage/dev-python/cython-0.15.1/work/Cython-0.15.1/tests-2.5/run/c/numpy_test.so", line 226, in numpy_test Failed example: print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=True)))) Exception raised: Traceback (most recent call last): File "/usr/lib64/python2.5/doctest.py", line 1228, in __run compileflags, 1) in test.globs File "<doctest numpy_test[72]>", line 1, in <module> print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=True)))) File "numpy_test.pyx", line 451, in numpy_test.test_partially_packed_align (numpy_test.c:7028) ValueError: Buffer dtype mismatch; next field is at offset 13 but 16 expected and a second 1 for a second partially_packed struct, basically the same thing twice. On bringing up the numpy_test.pyx, we find The following expose bugs in Numpy (versions prior to 2011-04-02): >>> print(test_partially_packed_align(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('sub', np.dtype('b,i')), ('c', 'i')], align=True)))) array([(22, 23, (24, 25), 26)], dtype=[('a', '|i1'), ('', '|V3'), ('b', '!i4'), ('sub', [('f0', '|i1'), ('f1', '!i4')]), ('', '|V3'), ('c', '!i4')]) >>> print(test_partially_packed_align_2(np.zeros((1,), dtype=np.dtype([('a', 'b'), ('b', 'i'), ('c', 'b'), ('sub', np.dtype('b,i', align=True))])))) array([(22, 23, 24, (27, 28))], dtype=[('a', '|i1'), ('b', '!i4'), ('c', '|i1'), ('sub', [('f0', '|i1'), ('', '|V3'), ('f1', '!i4')])]) well from the Changelog, *numpy-1.6.0_beta2 (07 Apr 2011) 07 Apr 2011; heralded the intro if the first pre-release of numpy-1.6 What is not clear to me is the meaning of "The following expose bugs ". That means to me these tests will make it trip and pull up, when the opposite occurs. What is clear is that only an installed numpy-1.5.1 will see a cython test phase pass and I have the logs to prove it. Now, what do we find in numpy_test.pyx; def test_partially_packed_align(np.ndarray[PartiallyPackedStruct] arr): arr[0].a = 22 arr[0].b = 23 arr[0].sub.a = 24 arr[0].sub.b = 25 arr[0].c = 26 return repr(arr).replace('<', '!').replace('>', '!') def test_partially_packed_align_2(np.ndarray[PartiallyPackedStruct2] arr): arr[0].a = 22 arr[0].b = 23 arr[0].c = 24 arr[0].sub.a = 27 arr[0].sub.b = 28 return repr(arr).replace('<', '!').replace('>', '!') The exact test quoted above, and sure enough that is exactly where the cython tests trip for > numpy 1.5.1; more than a coincidence. Perhaps the choice of words "The following expose bugs "is just completely mis-leading, but the outcome of testing the test phase of cython gives gentoo a headache for cython test phase failing against all installed numpy(s) but the oldest version in the tree. Is it that these two PartiallyPackedStruct & PartiallyPackedStruct2 are out of place in the current test suite seeing they only work in version 1.5.1? It does to me. Ought they be retained and hold the entire test phase to ransom? Will someone savant of numpy structs and arrays actually fix it? Ought they be removed from the test suite and allow cython to pass? Do we await upstream to fix it? Created attachment 295103 [details]
the build log
Fixed with cython 0.15.1 and numpy 1.6.1-r1 |