SIP and PyPy

Matti Picus matti.picus at gmail.com
Mon Jul 6 22:31:12 BST 2020


I recently began trying to build PyQT with PyPy 3.6 v7.3.1 [0]. The 
first problem I encountered was that SIP has a function


static struct _frame *sip_api_get_frame(int depth)


which queries the current frames on the stack. While PyPy provides a 
rudimentary PyEval_GetFrame(), it does not make much sense to try to 
traverse PyPy's frame stack since the JIT can change it at will. A 
couple of solutions might be:


- disallow sip_api_get_frame() for any depth but 0

- disallow the API function altogether on PyPy


Checks for PyPy in C can use the #ifdef PYPY_VERSION family of macros


Any thoughts?


When I disable this function, SIP builds and I can begin building PyQT. 
Unfortunately there are some missing C-API calls on PyPy, but I intend 
to try to fix them for the next release (should be sometime in August).


Matti


[0] PyPy download https://downloads.python.org/pypy/ or read this blog 
to get PyPy from conda https://conda-forge.org/blog/posts/2020-03-10-pypy/



More information about the PyQt mailing list