astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.43k stars 605 forks source link

Allow per-package overrides #2686

Open adzenith opened 5 months ago

adzenith commented 5 months ago

This comment discusses a second type of dependency overriding:

Replace the requirement on foo==1.2.3 in bar with foo==4.5.6. With this, you say "While bar wants foo 1.2.3, i have confirmed that it is actually compatible with foo 4.5.6, too". It requires more effort on the user side, but is less risky and gives good errors messages when new requirements on foo are added outside of bar.

The parent ticket was resolved based on the first idea (global overrides) and I didn't see another ticket to track this second idea, which as stated is less risky and could give better error messages. I would love to see this feature!

Thanks! I've been having an amazing time with uv so far.

hmc-cs-mdrissi commented 1 month ago

Supportive of this and hit it today. I have several libraries that depend on library A with various constraints. Most of them have flexible enough constraints that I want them to be used and resolved. A few have constraints that are too tight and I've tested and have confidence it's ok to relax a bit.

I ended up working around this by dropping dependencies I knew I could relax, resolving, then adding them back and adding override. Would be safer experience if I could say this directly.