-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip should support custom wheel platform tags. #2875
Comments
I presume your CI has a shared filesystem, NFS or something, with a common home dir? I have the same thing on my laptop, via LXC containers with home mapped into the container; and I'm expecting the shared cache (that I wrote :)) to bite me soon in that setup. SO yes - I like this idea. I'd want @dstufft's input on the approach before implementing though. |
I have mixed feelings about defining your own platform tag, but I think that the right place to deal with the general question of how to handle Linux platforms (or platforms in general) is via distutils-sig/Wheel. Once we have some standard way of doing it (even if it's "define your own platform tag") we can expose that in pip as it makes sense to do so for whatever solution we end up with. |
If you'd rather I bring the matter up on distutils-sig, I'd be happy to do that, but I think Pip should support custom platform tags no matter what. PEP0425 says "...built distributions should have a file naming convention that includes enough information to decide whether or not a particular archive is compatible with a particular implementation" but I believe "compatibility" is a matter of opinion. For example, I might want to ensure that my production deployments only include wheels compiled with Alternatively, if I have a C extension written to speed up some task, I might want to ensure that a wheel built with Even if two environments should be compatible, and distutils-sig gives them the same platform-tag, I might want to distinguish them just to avoid the risk that they might somehow be incompatible in some subtle way I haven't noticed yet. It would be silly and unmanageable for pip to fill the platform-tag with every possible difference that could ever possibly affect anyone, especially since even the people that care probably only care about one or two of them, and it's a different one or two for each person. However, I think it's reasonable to say "if you have compatibility concerns that the official platform-tag system doesn't represent, you can make up your own platform-tags as fine-grained as you want as long as you keep them to yourself and don't upload them to PyPI". |
I think there are compelling cases for custom platform tags for sure, pip doesn't actually build wheels though- it just calls out to the wheel project to do that. So at a minimum the wheel project would need to support it but we could (unless we did something gross, like rename the file after it was created, but i'd rather not do that). |
And of course the fact that this affects not just the pip project, but also the wheel project, is why it's best discussed on distutils-sig :-) |
I've raised it on distutils-sig |
And distutils-SIG says 'sounds good to us' |
Sweet! I should note that |
I don't think it works unless you specify a previously allowed one:
|
Ok, so we need to open an issue on wheel to make it possible to override (whether same option or a new one), then we can tackle it in pip. |
I've opened an issue on wheel: https://bitbucket.org/pypa/wheel/issue/144/bdist_wheel-should-support-custom-platform |
The issue for wheel has now been fixed. |
And now released in wheel 0.27.0. |
this was fixed in the wheel project... any plans to incorporate this into pip? currently I can build wheels with a custom platform-tag but have no way to easily install them with pip. i know i could write some scripts that go through and try to find requirements via curl calls to my private pypi server, but |
It would make sense to have something like an additional_supported_tags in the pip config file... |
If this is still not fixed in pip, how are you guys using the custom platform tags? |
Did this get fixed at some point with |
Custom platform specifier would be very welcome! Under FreeBSD the platform strings used by wheel are unusable (like 'freebsd_11_1_release_p1') and should probably be something like 'freebsd_11'. |
fyi, pip-custom-platform |
@analogue, thanks for the suggestion. |
I've labelled this issue as an "deferred till PR". This label is essentially for indicating that further discussion related to this issue should be deferred until someone comes around to make a PR. This does not mean that the said PR would be accepted, though I personally am fine with going ahead with this feature. |
As I understand it, the Wheel format has the notion of a 'platform tag', such that wheels built for the same version of Python with the same ABI but different platforms (say, CPython 3.4 on Windows vs. Mac OS X) will not collide. Although PEP0425 defines platform tags
linux_i386
andlinux_x86_64
, PyPI will not accept uploads of wheels for those platforms because they are not specific enough—alinux_x86_64
wheel built on, say, Debian 8 might not work on CentOS 7, and so forth.This is a good plan, and I support it.
However, inside the company I work for, the problem is much less complex - instead of a myriad of Linuxish platforms, we only have a handful, and we would love to be able to define custom platform tags for our internal packages, so we can be sure we're deploying the correct wheels to the correct hosts.
To be specific, I want a workflow something like the following:
I'm using Pip 7.0, so I have a shared wheel cache.
My CI system notices that somebody has committed a change to my project, so it tells a member of the build-farm to run the tests.
The build host happens to be one of our legacy CentOS 6 machines, so when it populates a virtualenv to run the tests, it runs:
...and so when pip consults its wheel cache, it only considers wheels whose platform tag is
optiver_centos_6
orany
. Furthermore, if it builds fresh wheels and caches them as part of the installation process, they will be tagged withoptiver_centos_6
if they contain C extensions (or whatever the usual logic is).Most likely, CI system will also run the tests on CentOS 7, doing the same steps but with
--platform-tag optiver_centos_7
.Later, when my project has passed all its tests and is ready for deployment, the build host should be able to gather a complete collection of wheels compatible with the given platform:
As before,
--platform-tag
should govern which wheels are pulled from the cache, as well as tagging wheels that are freshly-built.The text was updated successfully, but these errors were encountered: