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

PyPy: Module works, but wheels can't be installed/develop doesn't install in virtualenv #312

Closed
thesketh opened this issue May 26, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@thesketh
Copy link

  • Python 3.6.9 (7.3.1+dfsg-4~ppa2~ubuntu18.04, Apr 30 2020, 20:59:10) [PyPy 7.3.1 with GCC 7.5.0]
  • pip 20.1.1
  • The version of the bindings you're using, if any (e.g. pyo3, rust-cpython or cffi): pyo3
  • Does cargo build work? Yes (with release flag)
  • If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)? N/A

Please list the exact steps required to reproduce your error with all command output and if possible with a repository:

  • Build a wheel with PyPy
  • Try to install that wheel
  • Get "ERROR: WHEEL.whl is not a supported wheel on this platform."

An example using my repo:

clone https://github.com/thesketh/oxmol
cd oxmol
maturin build -i $(which pypy3) --release
pypy3 -mpip install target/wheels/oxmol-0.1.0-pp3pp73-pypy3_pp73-linux_x86_64.whl

The actual build process seems to run fine - I can import the module using PyPy without any issues when I'm in the root of the project:

pypy3 -c "import oxmol; atom = oxmol.AtomSpec('C'); print(atom)"
# should print PyAtomSpec { C, 0 hydrogens, Charge: 0, Isotope: None, Parity: None }

but the wheel can't be installed and maturin develop --release doesn't actually install the package into a virtualenv (seems to fail without error). This makes me think it's a packaging issue. Any ideas?

The PyPy version is the latest stable release from the Ubuntu ppa.

@thesketh
Copy link
Author

I've done a bit of digging into this, and it turns out that the PyPy tag changed in the latest version (7.3.1). This is apparently to be compliant with PEP 425

The Python tag is now e.g pp36 where 3 is the Python major version and 6 the Python minor version.

The ABI tag seems is now e.g. pypy36_pp73 (where 3 is the Python major version, 6 is the Python minor version, 7 is the PyPy major version and 3 is the PyPy minor version).

The correct tag for my release then becomes pp36-pypy36_pp73, which installed without issues using pip.

@konstin konstin added the bug Something isn't working label May 27, 2020
@mattip
Copy link

mattip commented Jun 6, 2020

I see two problems in the pypy-specific code in src/python_interpreter.rs, but I am not familiar with the project so it is difficult for me to suggest a fix, but I think the fix should be to more closely mimic the CPython code:

  • PyPy definitely supports multilinux2010.
  • the code "pp3{abi_tag}-pypy3_{abi_tag}-{platform}" is wrong, as reported in this issue. I think it should be "pp{major}{minor}-{abi_tag}-{platform}" (where abi_tag should be pypy36_pp73 which is the result of the python-language call sysconfig.get_config_var('SOABI').replace('-', '_')

@milesgranger
Copy link

Is there anything I could do to help this along? I'm experiencing this as well, but thanks to @mattip for the work around. Before, I would get the same "...not supported on this platform"

root@548533171e97:/code# mv wheels/cramjam-2.0.0_rc1-pp3pp73-pypy3_pp73-linux_x86_64.whl wheels/cramjam-2.0.0_rc1-pp36-pypy36_pp73-linux_x86_64.whl 
root@548533171e97:/code# pip install wheels/cramjam-2.0.0_rc1-pp36-pypy36_pp73-linux_x86_64.whl 
Processing ./wheels/cramjam-2.0.0_rc1-pp36-pypy36_pp73-linux_x86_64.whl
Installing collected packages: cramjam
Successfully installed cramjam-2.0.0rc1
root@548533171e97:/code# 

milesgranger added a commit to milesgranger/cramjam that referenced this issue Feb 18, 2021
Needs to run pypy_patch.py after builds until PyO3/maturin#312 is closed
Cannot support Windows PyPy until PyO3/maturin#115 is closed
@konstin
Copy link
Member

konstin commented Feb 19, 2021

I've updated the tag and manylinux status so for me pypy3.7-3.7 on linux works with latest master. Could you check whether they work for you too?

@milesgranger
Copy link

Sorry for the tardy response. I ran my CI but installing from latest master (d20c3a0) and seems like it's working, thanks!


(I have a pypy_patch.py script which renames files now, but looks like it won't be needed soon! 👍 )
image

@konstin konstin closed this as completed Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants