Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPy3.10: TypeError: No array-type handler for type _ctypes.array.ArrayMeta (value: <class '_ctypes.array.c_double_Array_16'>) registered #108

Open
mgorny opened this issue Nov 17, 2023 · 0 comments

Comments

@mgorny
Copy link

mgorny commented Nov 17, 2023

When attempting to run the test suite using PyPy3.10 7.3.13, it's immediately failing with the following exception:

$ pypy3 -m pytest tests
========================================================= test session starts =========================================================
platform linux -- Python 3.10.13[pypy-7.3.13-final], pytest-7.4.3, pluggy-1.3.0
rootdir: /tmp/pyopengl
plugins: anyio-4.0.0, xprocess-0.23.0, asyncio-0.21.1, xdist-3.4.0
asyncio: mode=strict
collected 66 items / 1 error / 1 skipped                                                                                              

=============================================================== ERRORS ================================================================
___________________________________________ ERROR collecting tests/test_gldouble_ctypes.py ____________________________________________
/usr/lib/pypy3.10/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/usr/lib/pypy3.10/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/pypy3.10/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/usr/lib/pypy3.10/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/usr/lib/pypy3.10/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/pypy3.10/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/lib/pypy3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/usr/lib/pypy3.10/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
tests/test_gldouble_ctypes.py:10: in <module>
    handler = arraydatatype.ArrayDatatype.getHandler( GLdouble * 16 )
OpenGL/arrays/arraydatatype.py:59: in __call__
    raise TypeError(
E   TypeError: No array-type handler for type _ctypes.array.ArrayMeta (value: <class '_ctypes.array.c_double_Array_16'>) registered
----------------------------------------------------------- Captured stdout -----------------------------------------------------------
dict_keys([])
========================================================== warnings summary ===========================================================
../../usr/lib/pypy3.10/site-packages/pygame/pkgdata.py:25
  /usr/lib/pypy3.10/site-packages/pygame/pkgdata.py:25: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import resource_stream, resource_exists

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================= short test summary info =======================================================
ERROR tests/test_gldouble_ctypes.py - TypeError: No array-type handler for type _ctypes.array.ArrayMeta (value: <class '_ctypes.array.c_double_Array_16'>) registered
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================================== 1 skipped, 1 warning, 1 error in 2.50s ================================================

CC @mattip

mgorny added a commit to mgorny/pyopengl that referenced this issue Nov 17, 2023
Add `_ctypes.array.ArrayMeta` to classes recognized by `ctypesarrays`
formathandler.  This is the class used by arrays on PyPy3.10.  Adding
this makes the test suite pass on PyPy3.10 7.3.13.

Fixes mcfletch#108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant