-
-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Labels
Description
Issue №425 opened by illume at 2018-03-19 14:18:32
pythonapi isn't on pypy, and they don't want to implement it.
- find what uses it (see below).
- add skips for tests that use pythonapi. We don't have to skip all of it.
- ask pypy devs about alternatives.
- use use memoryview for arritter.ArrayInterface with ctypes.
# What is pythonapi used for?
Array testing. pygame uses the python array interface, and has a ctypes based testing module for checking this stuff.
pygame/test/test_utils/arrinter.py
These are the functions from pythonapi it uses, with links to the CPython API docs.
- pythonapi.[PyCObject_AsVoidPtr](https://docs.python.org/2/c-api/cobject.html# c.PyCObject_AsVoidPtr) (arrinter) (py2)
- pythonapi.[PyCObject_GetDesc](https://docs.python.org/2/c-api/cobject.html?highlight=pycobject_getdesc# c.PyCObject_GetDesc) (arrinter)
- pythonapi.[PyCapsule_IsValid](https://docs.python.org/2/c-api/capsule.html# c.PyCapsule_IsValid) (optional) (arrinter)
- pythonapi.[PyCapsule_GetPointer](https://docs.python.org/3.6/c-api/capsule.html?highlight=pycapsule_getpointer# c.PyCapsule_GetPointer) (arrinter)
- pythonapi.[PyCapsule_GetContext](https://docs.python.org/3.6/c-api/capsule.html?highlight=pycapsule_getcontext# c.PyCapsule_GetContext) (arrinter)
- pythonapi.[PyCapsule_New](https://docs.python.org/3.6/c-api/capsule.html?highlight=pycapsule_new# c.PyCapsule_New) (py3) (arrinter)
- pythonapi.[PyCObject_FromVoidPtr](https://docs.python.org/2.7/c-api/cobject.html?highlight=pycobject_fromvoidptr# c.PyCObject_FromVoidPtr) (py2) (arrinter)
- pythonapi.[PyBytes_FromString](https://docs.python.org/3/c-api/bytes.html# c.PyBytes_FromString) (mixer_test.py)
Tests which use pythonapi (and skip such tests on pypy):
- base_test.py
- color_test.py
- freetype_test.py
- mixer_test.py
- pixelarray_test.py
- pixelcopy_test.py
- surface_test.py
Comments
# # illume commented at 2018-03-19 17:16:54
This could be used to get strides and such:
memoryview(array)
# # illume commented at 2022-01-22 20:01:51
The pypy issue tracker is here now: https://foss.heptapod.net/pypy/pypy/-/issues
Haven’t looked into if we need this stuff still. At least the python stuff could be removed. Maybe we should rip out the old buffer stuff first and then reassess.
# # illume commented at 2022-01-22 20:02:52
Here is the old buffer removal issue pygame/pygame#2949