-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Adds --platform option to the 'pip install --download' command #2911
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
Conversation
This doesn't offer the ability to build wheels of the specified architecture (because |
Right, this wasn't designed in order to build wheels of the wrong architecture, because that doesn't make sense. The option is meant to be used as so: pip wheel --no-index --find-links --architecture linux_x86_64 --no-index will tell pip to not search on platforms like PyPI, which can't support linux wheels, for example. --find-links will tell pip where to search for wheels instead. This assumes you already have a collection of wheels on the filesystem, potentially multiple copies of the same wheel that are supported by different architectures. The whole command isn't designed to build wheels, but rather to collect wheels and their dependencies, specifically for an architecture that isn't the local one. These wheels can then be distributed to someone else running that architecture, who will then build the wheels on their local machine. |
OK. Given the specialised usage, I'd suggest it shouldn't be something included in pip, but rather a standalone command. (I appreciate that means that you have to reimplement the index searching that pip provides in that case - although you could try using distlib). |
I don't think I have a problem with the idea, someone just asked for the ability to have a custom |
I was just considering the same thing, actually. That might be a better home for this functionality. |
|
Alright, thanks Donald. For now I'm planning on making sure I pass the CI, and then I'm going to move this option to 'pip install' and make sure that the --download option is also specified. I agree that 'pip download' as a command would be the best possible implementation, but I'm not sure I want to go that far down the rabbit hole. It could be a good follow up though. |
As discussed earlier, this functionality has been moved. Instead of living in the 'pip wheel' command, it lives in 'pip install', and is invoked with the option '--platform'. It requires that the option '--download' is also specified, otherwise it raises a CommandError. Example usage: |
@dstufft, is there anything else that needs to be done to make this PR merge worthy? (Sorry, I accidentally clicked "close and comment" instead of "comment") |
Using this command, a user can ask for wheels of a different architecture than that of the local machine running the command. In this way, a user running pip on a macosx machine can run 'pip wheel --no-index --find-links <target_dir> --architecture linux_x86_64 ' and gather a target wheel and all of its dependencies (which only install on linux machines). This can be used to bundle wheels of many different platforms/architectures for distribution later.