opengl-accelerate import level >=0 for python 3.3
Brought to you by:
mcfletch
There is an incompatibility between python 3.3 and PyOpenGL-accelerate that is fortunately easy to fix. Attached is a patch. Without it, you get errors of this sort:
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/OpenGL/GL/__init__.py", line 3, in <module> from OpenGL.GL.VERSION.GL_1_1 import * File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 10, in <module> from OpenGL import platform, constants, constant, arrays File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/OpenGL/arrays/__init__.py", line 19, in <module> from OpenGL.arrays.arraydatatype import * File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/OpenGL/arrays/arraydatatype.py", line 14, in <module> from OpenGL_accelerate.arraydatatype import ArrayDatatype as ADT File "arraydatatype.pyx", line 1, in init OpenGL_accelerate.arraydatatype (src/arraydatatype.c:9315) File "wrapper.pyx", line 2, in init OpenGL_accelerate.wrapper (src/wrapper.c:10792) ValueError: level must be >= 0
patch
Thanks for the bug report. Note that you actually patched auto-generated files, rather than the source files. Cython updated to 0.19.1 seems to have generated Python 3.3 compatible files in my testing.
The auto-generated are included in the source distribution and not generated at build time. Could you update the opengl-accelerate tar ball with correct auto-generated files? Or is there an easy additional build step to regenerate the code with cython?
The step isn't obvious (you have to delete the generated src/.c files and then re-run setup.py install with cython installed). To release* a new accelerate module I need to boot into Windows and spend time compiling the modules for the various Python versions (and testing the results). I'm afraid I don't have time to get that done this week.
I don't want to silently update the files (i.e. same version different sources), as the regenerated files are quite different from the originals, since this is a new major version of cython generating them.
If I remove all *.c files and try to install I get errors like these:
It seems like formathandler.c and wrapper.c were correctly generated, but cython choked on arraydatatype.pyx. This happens both with python2.7 and python3.3.
3.1.0 beta1 fails to build on OSX 10.5 with gcc 4.2 with the same error as in the comment above.
3.0.2 builds fine however.
I am using Cython 0.20.1, so that should not be a problem, right?
Here is the full log up to the first error:
Last edit: Antoine Martin 2014-03-11
Forgot to mention that this is not using Python 3.x but Python 2.7.6
Note that your error is quite different. You are seeing a build failure because cython isn't finding the pxd files. Those are (in the b1 release) in the OpenGL_accelerate directory. I've modified the repository so that they are in the OpenGL_accelerate/src directory instead, and I've made the references in the setup.py script concrete, which should eliminate the particular error you are seeing.
Confirmed fixed. Thank you very much!
(sorry for posting this bug here instead of creating a new one, I just assumed it was the same issue as the compilation error message is identical to the one posted in comment just above mine)