-
Notifications
You must be signed in to change notification settings - Fork 762
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
Should uv add
set lower version bounds?
#5178
Comments
I think this is a great default. cc @konstin |
Most package managers add lower bounds (though I don't know how they select the version to solve for). I was bitten by this today because in CI I cannot use uv lockfiles and I resorted to export with My 2 cents: no upper boundaries. Python is not JS: we don't have peer dependencies. Distributing a library with |
What do we want the lower bound to be... The version we resolve to, or the minimum compatible version in the resolution? |
Adding a lower bound carries the implication that the codebase isn't compatible with earlier versions. If we resolve to the latest version of the package, this ends up being a quite strict assumption and can force a dependent installing your package to upgrade unnecessarily. This might be desirable initially until the codebase has actually been tested on older versions of packages; but it is arguably too cautious, especially when using On the other hand, if a user starts by adding a single dependency (e.g. Personally, I think using the version we resolve to is more sensible. Perhaps only include the Major.Minor parts of a SemVer version. |
I've been thinking that as a follow-up to adding a lower bounds with Say you added From the resolution, we know that there is a 2.0.0 2.0.0rc2 2.0.0rc1 2.0.0b1 1.26.4 1.26.3 1.26.2 1.26.1 1.26.0 1.26.0rc1 1.26.0b1 1.25.2 1.25.1 1.25.0 We remove prerelease versions since they are not selected: 2.0.0 1.26.4 1.26.3 1.26.2 1.26.1 1.26.0 1.25.2 1.25.1 1.25.0 We start with |
I can do it. |
This is a bit of a pain because we need to add the requirement before resolving, then resolve, then update the |
I wouldn't be hurt if we dropped this from the release-ready milestone. |
I will try to do this tomorrow. |
I'm a bit late to the conversation, but one heuristic you might find as a helpful fallback if users of projects have not setup or do not use pytest, is if the dependency provides wheels, what's the earliest version of the dependency that has compatible wheels with some version of Python that matches those wheels. E.g. For numpy if your project is |
Currently,
uv add foo
adds"foo"
as a requirement with no version constraint. Should it instead perform a resolution and require"foo>X"
?There's a lot of resistance against upper bounds so we probably don't want to add them by default (though I don't have much context about this problem myself), but lower bounds are reasonable to include.
The text was updated successfully, but these errors were encountered: