mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Ignore upper-bounds on Requires-Python
(#4086)
## Summary This PR modifies our `Requires-Python` handling to treat `Requires-Python` as a lower bound. There's extensive discussion around this in https://github.com/astral-sh/uv/issues/4022 and the references linked therein. I think it's an experiment worth trying. Even in my own small projects, I'm running into issues whereby I'm being "forced" to add a `<4` upper bound to my `Requires-Python` due to these caps. Separately, we should explore adding a mechanism that's distinct from `Requires-Python` to enable users to declare a supported range for locking. Closes https://github.com/astral-sh/uv/issues/4022.
This commit is contained in:
parent
30e73a60de
commit
31bb01f0be
5 changed files with 143 additions and 62 deletions
|
@ -730,7 +730,7 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
|||
// The version is incompatible due to its Python requirement.
|
||||
if let Some(requires_python) = metadata.requires_python.as_ref() {
|
||||
if let Some(target) = self.python_requirement.target() {
|
||||
if !target.subset_of(requires_python) {
|
||||
if !target.contains(requires_python) {
|
||||
return Ok(Some(ResolverVersion::Unavailable(
|
||||
version.clone(),
|
||||
UnavailableVersion::IncompatibleDist(IncompatibleDist::Source(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue