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
Let pip deal with whl filename #1784
base: master
Are you sure you want to change the base?
Conversation
The |
I see but what I meant is whl filename should not be touched. Rather it should be used proper platform/docker to build a whl for maximum compatibility and during wheel creation pip will set proper filename/tag. In addition to this, the support for Removing that hack you would still be able to build whl with |
We are actually using
I mean we could upgrade |
I think I didn't explain myself well. Main issue here is you are not considering there is also Anyway feel free to reject but I'm pretty sure this code has to go, things have changed over these 7 years (I do see that code was added back then). |
I got your point now. It's not good to force
Yes, I agree with you. How could I reproduce your problem? I could try to figure the correct way for this. |
If you then try to install
But in theory this last step would not be needed with the code from this PR. |
I can also confirm that the whl generated from an |
Any updates? |
I once tested this approach and got some problems I remember... I will retry asap. |
I read through the docs. Seems that we should have something like |
Regarding PEP656, I think the correct way to do this is to add a brand new wheel (i.e. build wheel on alphine containers instead of manylinux) because much of our code (or qemu) might be not. I will add a new CI artifact for that. |
Yeah so basically to control this and to produce proper wheel you should use a glibc-based docker image as well as a musl libc-based docker image. On each of them you should be able to produce a wheel package that is compatible with relative distros. |
I tried to create a whl from an alpine linux docker image of the latest Unicorn release and the whl build works fine but due to that
if
statement removed in this PR, during pip install it returns the following error:ERROR: unicorn-2.0.1.post1-py2.py3-none-manylinux1_x86_64.whl is not a supported wheel on this platform.
This because the
if
forces to setmanylinux1
tag in the filename and that matters for pip during the installation. In fact, doing a simple rename of the whl file by replacingmanylinux1
withany
, pip installs the whl without any problems. Of course rather renaming like I did, the proper way to do this is throughauditwheel repair
, which in this case actually repairs and creates a new whl file indeed with appropriate tags.Doing this you will generate a whl file that will be compatible for both tags platform, hence when installing from alpine for instance the end user will not end up compiling the whl every time since the whl file pushed to pypi will be detected as fine for the given platform.
setup.py
:unicorn-2.0.1.post1-py2.py3-none-manylinux1_x86_64.whl
setup.py
after the auditwheel repair:unicorn-2.0.1.post1-py2.py3-none-manylinux1_x86_64.musllinux_1_2_x86_64.whl
setup.py
modified in this PR:unicorn-2.0.1.post1-py2.py3-none-any.whl
The auditwheel repair is not required if this PR gets accepted but if you think that this change will break builds for other platforms then I guess this can be added into your Github Actions during whl creation before pushing to pypi index, just in case.
Of course more tests can be performed using different docker images but this change should be fine enough.