Do we have something similar to `--override` in uv...
# general
h
Do we have something similar to
--override
in uv?
• uv allows for dependency “overrides”. uv takes pip's “constraints” concepts a step further via overrides (
-o overrides.txt
), which allow the user to guide the resolver by overriding the declared dependencies of a package. Overrides give the user an escape hatch for working around erroneous upper bounds and other incorrectly-declared dependencies.
https://astral.sh/blog/uv#a-drop-in-compatible-api
I want to force a transitive dependency to a specific version.
h
Isn’t this just constraints.txt? Not sure how it takes it a step further
h
Constraints would still fail when dependencies are 'unsatisfiable'.
In other words, constraints would constraint the space of valid dependency versions.
Overrides would impose a dependency version, even if it's not in the valid dependency versions.
h
Could it add new dependencies entirely? Or remove dependencies? Or just impose versions on things already in the dependency closure?
Thanks to @brief-scientist-13682 Pex does have this feature, we would need to plumb it through in Pants at lockfile generation time.
h
Maybe we can make the plumbing more transparent? A kind of pass-through.
As I understand, it would mainly impose versions.
h
Some plumbing can be made transparent, but in this case a little modeling is required. Specifically, where would the overrides come from? Are they global in the repo, or per lockfile? Or per target?
h
The overrides would, I think, be specified per lockfile. Analogous to constraints.
h
That makes sense, doing whatever we currently do for constraints is probably the path of least resistance