Track supported Python range in lockfile (#4065)

## Summary

This PR adds the `Requires-Python` range to the user's lockfile. This
will enable us to validate it when installing.

For now, we repeat the `Requires-Python` back to the user;
alternatively, though, we could detect the supported Python range
automatically.

See: https://github.com/astral-sh/uv/issues/4052
This commit is contained in:
Charlie Marsh 2024-06-05 16:21:59 -04:00 committed by GitHub
parent 8596525d97
commit 642cef0dad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 58 additions and 9 deletions

View file

@ -557,7 +557,13 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
for resolution in resolutions {
combined.union(resolution);
}
ResolutionGraph::from_state(&self.index, &self.preferences, &self.git, combined)
ResolutionGraph::from_state(
&self.index,
&self.preferences,
&self.git,
&self.python_requirement,
combined,
)
}
/// Visit a [`PubGrubPackage`] prior to selection. This should be called on a [`PubGrubPackage`]