Pypy3 pip install recordclass

Viewed 288

Trying to pip install recordclass (0.14.3) module to my pypy3 (PyPy 7.3.4-alpha0 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)) virtualenv but getting an issue. Is there a way to get this installed? Or does the library currently not support pypy?

Small snippet of the error is:

 1024 |     _PyUnicodeWriter_Dealloc(&writer);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~
    lib/recordclass/_dataobject.c: In function 'dataobjectiter_reduce':
    lib/recordclass/_dataobject.c:2032:39: warning: implicit declaration of function '_PyObject_GetBuiltin'; did you mean 'PyObject_GetBuffer'? [-Wimplicit-function-declaration]
     2032 |         return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
          |                                       ^~~~~~~~~~~~~~~~~~~~
          |                                       PyObject_GetBuffer
    lib/recordclass/_dataobject.c: In function 'PyInit__dataobject':
    lib/recordclass/_dataobject.c:2916:9: warning: implicit declaration of function 'PyState_FindModule' [-Wimplicit-function-declaration]
     2916 |     m = PyState_FindModule(&dataobjectmodule);
          |         ^~~~~~~~~~~~~~~~~~
    lib/recordclass/_dataobject.c:2916:7: warning: assignment to 'PyObject *' {aka 'struct _object *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
     2916 |     m = PyState_FindModule(&dataobjectmodule);
          |       ^
    error: command 'gcc' failed with exit status 1
1 Answers

I opened an issue https://foss.heptapod.net/pypy/pypy/-/issues/3438. But if increased performance is your objective, recordclass is probably the wrong tool for PyPy. It uses the (unlimited) C-API which is slow on PyPy. You probably are better off using namedtuples.

Related