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

Is PyPy supported? #219

Closed
ghuls opened this issue Nov 9, 2021 · 3 comments · Fixed by #249
Closed

Is PyPy supported? #219

ghuls opened this issue Nov 9, 2021 · 3 comments · Fixed by #249

Comments

@ghuls
Copy link

ghuls commented Nov 9, 2021

Is PyPy supported?

I tried the sinple-extension example, but it does not seem to work:

cd examples/simple-extension

$ maturin develop  -b cffipypy
Python 3.7.12 | packaged by conda-forge | (44db2626, Oct 29 2021, 16:13:40)
[PyPy 7.3.7 with GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy as np
>>>> import rust_ext
>>>> rust_ext.axpy(2.0, np.array([0.0, 1.0]), np.array([2.0, 3.0]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'rust_ext' has no attribute 'axpy'
>>>> 
@davidhewitt
Copy link
Member

I'm not aware of reasons why it shouldn't be supported. Which maturin version are you using and why do you use -b cffi?

@adamreichold
Copy link
Member

I am adding basic tests for PyPy on Linux to our CI and will tentatively close this if that works out. Please feel free to re-open if the problem persists.

@ghuls
Copy link
Author

ghuls commented Jan 8, 2022

I'm not aware of reasons why it shouldn't be supported. Which maturin version are you using and why do you use -b cffi?

At the time I couldn't get the project that uses rust-numpy to compile when targeting PyPy, as PyO3 was missing PyPyObject_HasAttr to PyObject_HasAttr mapping, so hasattr in my code did not work with PyPy:
PyO3/pyo3#2025

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

Successfully merging a pull request may close this issue.

3 participants