uv icon indicating copy to clipboard operation
uv copied to clipboard

Move `Requires-Python` incompatibilities out of version map

Open charliermarsh opened this issue 1 year ago • 2 comments

Summary

This is required to solve https://github.com/astral-sh/uv/issues/4669, because the Requires-Python version can now vary across a resolution. For example, within certain forks, we might have a more narrow range, which would allow us to use distributions that would not be allowed for the global resolution.

This should be fine because requires-python is part of the package metadata, so it should be consistent between files within a package version. As such, there shouldn't be any risk that we incorrectly prioritize distributions by omitting this information.

(To be more specific, the risk is something like: we prioritize some wheel over a source distribution within a package-version, so we don't track the source distribution at all. Then, later, when we choose a candidate, we see that the wheel doesn't meet the Requires-Python requirement, even though the source distribution would've met it. If files within a distribution could have varied support, this would be a real risk.)

charliermarsh avatar Jul 01 '24 20:07 charliermarsh

Originally moved here in https://github.com/astral-sh/uv/pull/1298

zanieb avatar Jul 01 '24 21:07 zanieb

I think having it in the version map is actually nice, but it's no longer possible unfortunately.

charliermarsh avatar Jul 01 '24 21:07 charliermarsh