Closed darkjh closed 6 years ago
At some point I had pretty much all tests passing on Pypy (except for threading stuff if I remember correctly).
The Pypy compat code generated by Cython seems to lack PyByteArray_AS_STRING
...
It seems that pypy does not expose it https://bitbucket.org/pypy/pypy/issue/1692/expose-pybytearray_as_string-in-cpyext
Is there a workaround?
A bytearray
is only used once in Plyvel: https://github.com/wbolster/plyvel/blob/master/plyvel/_plyvel.pyx#L124
Actually it's only used for compatibility with Python 2 and Python 3; maybe it can be adapted to have an alternative for Pypy?
I found that I can compile Cython codes (Make all) and install them under pypy (python setup.py develop under pypy virtualenv) and it seems working (batch write and iteration). But pip install does not work.
Perhaps the Cython versions are different? Can you look at the versions?
No I've tried install a Cython 0.19.2 in a pypy virtualenv then pip install plyvel but no success.
Maybe I didn't use all features (juste writing and iterating) so it seems to work. (say I don't touch the part of bytearray
).
The error you show above is a compilation error. If the compilation fails, nothing works and the import will fail. So it's not possible it's partly working...
@wbolster I just return to this issue (sry for delay). Can I just workaround the problem by replacing the bytearray
by other things that pypy supports? Currently we are only on py2.
If in this line: https://github.com/wbolster/plyvel/blob/master/plyvel/_plyvel.pyx#L130
I just assign b = s
, will that work for py2 under pypy?
No that won't work. The whole thing is written specifically because it is different in py2/py3, and bytearray
makes it work on both. I think I can change it to not use bytearray
if that would help for PyPI.
Being able to run plyvel under PyPy would be a good thing for electrum-server. :+1:
Being able to run plyvel under PyPy would be a good thing for Ethereum too. :+1:
fwiw: unit tests pass on the latest pypy3.5
closing this since it seems to work on recent pypy (tests pass)
I've just tried to install
plyvel
in pypy but got the following error:I know that
plyvel
does not target Pypy but just want to know if it's possible to make it work with reasonable effort? It seems Cython has some support to generate Pypy compat code.