uv icon indicating copy to clipboard operation
uv copied to clipboard

`implementation` parameter from `pip install` missing in `uv pip install / compile`

Open schlamar opened this issue 1 year ago • 1 comments

Follow up of #6198

With pip you can use --implementation py to only select packages which don't have platform dependent binary content. I couldn't find a way to reproduce this behavior with uv. See https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/

Would be great if this could be supported in uv for the relevant operations as well. I guess that would be uv pip install and maybe uv pip compile.

schlamar avatar Aug 20 '24 06:08 schlamar

I did a little a bit of experimentation (see #6553)

For my actual use case, to select only pure Python wheels (implementation, platform and abi agnostic), I just learned that you have to pass --implementation py --abi none --platform any to pip to get the expected behavior. Apperently it is perfectly fine to provide a wheel with a py310-none-win_amd64 tag - for example if it is a pure Python library with embedded .exe or .dll file.

Maybe uv could provide a shortcut flag for getting this kind of behavior, --pure-wheels or something like that. I think I would be able to provide a PR for this part.

Additionally, there is the general use case to define implementation, abi and platform to get specific wheels. In pip you can define multiple abis and multiple platforms. I do not really see a real world use case for the latter part, but specifying multiple abis could make sense. For example if you want to install a Linux compatible wheel you could allow different manylinux abis.

I guess for the second part it needs more time and input from other to define a precise specification. It could require a lot of internal refactoring to select multiple abis from a command line argument.

schlamar avatar Aug 24 '24 07:08 schlamar