mcfletch / pyopengl

Repository for the PyOpenGL Project
Other
314 stars 97 forks source link

Test failures with Python 3.12.0b3 #99

Closed swt2c closed 2 months ago

swt2c commented 1 year ago

I'm seeing a few test failures when building pyopengl for Python 3.12.0b3 on Fedora. (Note: numpy doesn't have wheels for Python 3.12 yet - but you can use the nightly wheels from here: https://anaconda.org/scientific-python-nightly-wheels/numpy/). pyopengl builds successfully, but some tests fail. The failures are all similar, due to exceptions like this:

ctypes.ArgumentError: ("argument 2: TypeError: No array-type handler for type <class '_ctypes.CArgObject'> (value: <cparam 'P' (0x7fc0e72f7ca0)>) registered",

Here's one failure:

________________________ TestCore.test_orinput_handling ________________________
self = <test_core.TestCore testMethod=test_orinput_handling>
    def test_orinput_handling( self ):
        if not glGenVertexArrays:
            return None
        x = glGenVertexArrays(1)
        x = int(x) # check that we got x as an integer-compatible value
        x2 = GLuint()
>       r_value = glGenVertexArrays( 1, x2 )
PyOpenGL-3.1.6/tests/test_core.py:534: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/latebind.pyx:39: in OpenGL_accelerate.latebind.LateBind.__call__
    ???
src/wrapper.pyx:314: in OpenGL_accelerate.wrapper.Wrapper.__call__
    ???
src/wrapper.pyx:311: in OpenGL_accelerate.wrapper.Wrapper.__call__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <CFunctionType object at 0x7fc0e72cb1d0>
args = (1, <cparam 'P' (0x7fc0e72f7f20)>), named = {}
    def __call__( self, *args, **named ):
        if not self.ccisvalid():
            from OpenGL import error
            raise error.NoContext( self.func.__name__, args, named )
>       return self.func( *args, **named )
E       ctypes.ArgumentError: ("argument 2: TypeError: No array-type handler for type <class '_ctypes.CArgObject'> (value: <cparam 'P' (0x7fc0e72f7f20)>) registered", (1, <cparam 'P' (0x7fc0e72f7f20)>))
../../BUILDROOT/python-pyopengl-3.1.6-2.fc39.x86_64/usr/lib/python3.12/site-packages/OpenGL/platform/baseplatform.py:41: ArgumentError
JPLeBreton commented 3 months ago

My distro just upgraded to Python 3.12, and I'm seeing this error on some of my software. But it looks like my distro upgraded the package recently? So I'm not sure why I'm seeing the error.

JPLeBreton commented 3 months ago

Oh, I see. That package only tracks the official releases, and a new release of PyOpenGL hasn't been tagged since those fixes went in.

AElimrani commented 3 months ago

Yes, the package requires manual compiling for version 3.12. I think the fixes are already merged but require a new release. I managed to monkey patch it (like in the expyriment issue), but I wonder if there aren't other issues that are blocking a release that I just haven't stumbled upon