-
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
pip-compatiblity: PIP_CONSTRAINT and PIP_CONSTRAINTS are not used, only UV_CONSTRAINT is used #10686
Comments
We don’t respect pip environment variables anywhere, as a rule. The full list of environment variables that affect uv is enumerated here: https://docs.astral.sh/uv/configuration/environment/ |
@charliermarsh Maybe it would worth displaying a warning if PIP_CONSTRAINT(S) is found as defined, mentioning the uv will not use it. This could save a good number of hours to those trying to migrate or use both. As someone that defined these in his user profile, I do face few surprises...
|
Related: ansible/ansible-compat#446 Related: astral-sh/uv#10686
Related: ansible/ansible-compat#446 Related: astral-sh/uv#10686
Related: ansible/ansible-compat#446 Related: astral-sh/uv#10686
I found the hard way after migrating from pip to uv on few projects that my lock files are no longer working, just because
uv pip
command seems to ignore presence ofPIP_CONSTRAINT
orPIP_CONSTRAINTS
file and thus failed to lock the dependencies during install.I tried defining
UV_CONSTRAINT
and it worked as expected. This is a divergence from the claimed API compatibility. Sadly the documentation page from https://docs.astral.sh/uv/pip/compatibility/#build-constraints does mention the constraints only on build constraints, not also on install.I do believe that the desirable fix here is to look for environment variables in this order:
Example
The text was updated successfully, but these errors were encountered: