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

Better support for PyPy #1049

Closed
mattip opened this issue Oct 31, 2020 · 10 comments
Closed

Better support for PyPy #1049

mattip opened this issue Oct 31, 2020 · 10 comments
Labels
enhancement New feature or request kit
Milestone

Comments

@mattip
Copy link

mattip commented Oct 31, 2020

Looking at a comparison of running the tox CI on Ubuntu with CPython3.6 or PyPy3.6, the CPython tests take 22secs, the PyPy ones 59 secs. Would it run faster on PyPy without the CTracer?

It would also be nice to provide wheels for PyPy. If c-extensions are not used this could be a pypy-specific pure-python version like coverage-5.3-pp36-none-none.whl

xref PyPy issue 3337

@mattip mattip added the enhancement New feature or request label Oct 31, 2020
@nedbat
Copy link
Owner

nedbat commented Oct 31, 2020

Would it run faster on PyPy without the CTracer?

PyPy doesn't use the CTracer. It uses PyTracer, which could be the reason for difference in speed.

It would also be nice to provide wheels for PyPy. If c-extensions are not used this could be a pypy-specific pure-python version like coverage-5.3-pp36-none-none.whl

I'm happy to provide more wheels. Do you know what I would have to do to make it happen?

@mattip
Copy link
Author

mattip commented Nov 1, 2020

Ahh, sorry, I missed that setup.py checks for PyPy.

As for wheels, pypy3 setup.py bdist_wheel builds dist/coverage-5.3.1-py3-none-any.whl. You don't want to upload that since it will be picked up by any python3, (cpython3.7, pypy3.6, ...), so you need to rename it to dist/coverage-5.3.1-pp36-none-any.whl. Unfortunately, pypa/packaging originally rejected, but is willing to reconsider using a pp3python tag, so until someone does that work you would need to copy it to dist/coverage-5.3.1-pp37-none-any.whl as well. Then you could upload those two packages to PyPI.

@mattip
Copy link
Author

mattip commented Nov 1, 2020

You could also use --python-tag to get wheel to do the renaming for you. So the complete script would be

pypy3 -mpip install wheel
pypy3 setup.py bdist_wheel --python-tag pp36
pypy3 setup.py bdist_wheel --python-tag pp37
<upload dist/* to pypi>

@nedbat nedbat added the kit label Dec 6, 2020
@nedbat
Copy link
Owner

nedbat commented Dec 6, 2020

I recently switched to cibuildwheel to make kits: https://github.com/nedbat/coveragepy/blob/master/.github/workflows/kit.yml
It makes these kits:

coverage-5.3.1-cp27-cp27m-macosx_10_9_x86_64.whl
coverage-5.3.1-cp27-cp27m-manylinux1_i686.whl
coverage-5.3.1-cp27-cp27m-manylinux1_x86_64.whl
coverage-5.3.1-cp27-cp27m-manylinux2010_i686.whl
coverage-5.3.1-cp27-cp27m-manylinux2010_x86_64.whl
coverage-5.3.1-cp27-cp27m-win32.whl
coverage-5.3.1-cp27-cp27m-win_amd64.whl
coverage-5.3.1-cp27-cp27mu-manylinux1_i686.whl
coverage-5.3.1-cp27-cp27mu-manylinux1_x86_64.whl
coverage-5.3.1-cp27-cp27mu-manylinux2010_i686.whl
coverage-5.3.1-cp27-cp27mu-manylinux2010_x86_64.whl
coverage-5.3.1-cp35-cp35m-macosx_10_9_x86_64.whl
coverage-5.3.1-cp35-cp35m-manylinux1_i686.whl
coverage-5.3.1-cp35-cp35m-manylinux1_x86_64.whl
coverage-5.3.1-cp35-cp35m-manylinux2010_i686.whl
coverage-5.3.1-cp35-cp35m-manylinux2010_x86_64.whl
coverage-5.3.1-cp35-cp35m-win32.whl
coverage-5.3.1-cp35-cp35m-win_amd64.whl
coverage-5.3.1-cp36-cp36m-macosx_10_9_x86_64.whl
coverage-5.3.1-cp36-cp36m-manylinux1_i686.whl
coverage-5.3.1-cp36-cp36m-manylinux1_x86_64.whl
coverage-5.3.1-cp36-cp36m-manylinux2010_i686.whl
coverage-5.3.1-cp36-cp36m-manylinux2010_x86_64.whl
coverage-5.3.1-cp36-cp36m-win32.whl
coverage-5.3.1-cp36-cp36m-win_amd64.whl
coverage-5.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
coverage-5.3.1-cp37-cp37m-manylinux1_i686.whl
coverage-5.3.1-cp37-cp37m-manylinux1_x86_64.whl
coverage-5.3.1-cp37-cp37m-manylinux2010_i686.whl
coverage-5.3.1-cp37-cp37m-manylinux2010_x86_64.whl
coverage-5.3.1-cp37-cp37m-win32.whl
coverage-5.3.1-cp37-cp37m-win_amd64.whl
coverage-5.3.1-cp38-cp38-macosx_10_9_x86_64.whl
coverage-5.3.1-cp38-cp38-manylinux1_i686.whl
coverage-5.3.1-cp38-cp38-manylinux1_x86_64.whl
coverage-5.3.1-cp38-cp38-manylinux2010_i686.whl
coverage-5.3.1-cp38-cp38-manylinux2010_x86_64.whl
coverage-5.3.1-cp38-cp38-win32.whl
coverage-5.3.1-cp38-cp38-win_amd64.whl
coverage-5.3.1-cp39-cp39-macosx_10_9_x86_64.whl
coverage-5.3.1-cp39-cp39-manylinux1_i686.whl
coverage-5.3.1-cp39-cp39-manylinux1_x86_64.whl
coverage-5.3.1-cp39-cp39-manylinux2010_i686.whl
coverage-5.3.1-cp39-cp39-manylinux2010_x86_64.whl
coverage-5.3.1-cp39-cp39-win32.whl
coverage-5.3.1-cp39-cp39-win_amd64.whl
coverage-5.3.1.tar.gz

I guess I need more education: how specifically would the pp37 wheel improve things? I can add the steps you mention, but it would help me to understand the benefit.

@nedbat nedbat added this to the 5.next milestone Dec 6, 2020
@nedbat
Copy link
Owner

nedbat commented Dec 6, 2020

I'm trying out your steps in #1077

@mattip
Copy link
Author

mattip commented Dec 7, 2020

cool. That is an impressive list of wheels. FWIW, NumPy is planning to drop manylinux1 by July 2021.

I see since this is a "workflow_dispatch" run of github actions, you will have to run it manually. I wonder if there is a way to toggle upload to pypi-test instead of to pypi in order to try it out.

@nedbat
Copy link
Owner

nedbat commented Dec 7, 2020

For now, I'm happy to handle the uploading manually (well, automated from my machine). What is it that we are gaining by having pp36 and pp37 wheels over the source distribution?

@mattip
Copy link
Author

mattip commented Dec 7, 2020

It could save a few seconds in installing the package since pip install will download the source, unpack the tar.gz, build a wheel (essentially repacking it in a zip format) and then unpack the wheel into site-packages.

@nedbat
Copy link
Owner

nedbat commented Dec 7, 2020

The new wheels are now built, as a result of #1077.

@nedbat nedbat closed this as completed Dec 7, 2020
@mattip
Copy link
Author

mattip commented Dec 7, 2020

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kit
Projects
None yet
Development

No branches or pull requests

2 participants