-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support --prefer-binary
in requirements.txt
files
#1794
Comments
I think we support |
We already always prefer binaries, right? I believe that's why we omitted the flag. I'm not sure these belong in the requirements file. Just wondering, why is this preferred (other than compatibility)? |
I'm not sure what
Honestly, I also don't know if it belongs there. I reported this because In general though, the benefit of having this setting in the requirements file itself is that you don't have to specify this setting in all your installers, e.g. CI / Makefile / Dockerfile / ... . The setting is in one place, together with the requirements. That does make some sense. |
@zanieb -- I think |
I am +1 for this feature. A use case is that h5py linux_aarch64 wheels are available in v3.10 but not available in v3.11 (see h5py/h5py#2408). When I use pip, I can set We need uv to support the |
@njzjz Is there a reason that this flag is better than just adding a pin or additional constraint? |
You may not want to pin a dependency to take advantage of the latest updates whenever they come out. However, you generally also want to avoid compiling packages from source if binaries are available. This setting unifies the two. Constraints may not work, or I would have to micromanage these for each dependency / platform depending on the wheels that are available. A single |
This flag will also ensure the CI is not broken in the future when a new release doesn't contain the binary. Otherwise, we need to add the pin manually every time. |
My use case for Ideally I would use |
I created #4291 for the environment variable support request. |
I agree that this would be useful for compatibility purposes; I'm setting up the matplotlib test environment, and was hoping to use
|
It would be good if it was in the pip the compatibility document: https://github.com/astral-sh/uv/blob/main/PIP_COMPATIBILITY.md I guess anyone could submit a PR for that? |
pip
supports including a--prefer-binary
flag in a requirements.txt like so:However,
uv pip install
does not support this:This is on version
0.1.6
.It would be nice if this syntax could be supported!
The text was updated successfully, but these errors were encountered: