-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Force uv to skip certain (transitive) dependencies #9174
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
Comments
It would be great to have a proper solution for this, not just a hack. We have a similar situation in our container setup, but the number of packages much larger. See also discussion in #2500 |
I think using overrides with an "impossible" marker is actually kind of a fine solution? The alternative is that we introduce something non-standard. |
I think this should be tracked in #4422 though. |
Thank you both. Super helpful. The solution seems fine to me. For anyone else that stubmless upon this issue. Add the following to your pyproject.toml. If you have a top-level pyproject.toml and any additional package specific ones, you should add it to the top-level pyproject.toml
|
I would just note that this is quite a dangerous solution to the original problem, since if a package depends on a torch version that is not satisfied by the underlying environment this will result in a broken installation. |
Is there a way to force uv to skip certain dependencies? Specifically we use docker containers maintained by Nvidia, which come pre-installed with various python ML packages on the system level (torch, apex, amp_C, flash-attn). If I use
uv venv --system-site-packages
then I can access those dependencies, the problem is that if any package that I install has a transitive dependency on one of these packages (primarily torch), then the one installed in venv will be chosen over the system one, and things break. I'd like to be able to specify that torch for example should not be installed as a transitive dependency, but I'm not sure how to do this.The text was updated successfully, but these errors were encountered: