Allow user to constrain supported lock environments (#6210)

## Summary

The strategy here is: if the user provides supported environments, we
use those as the initial forks when resolving. As a result, we never add
or explore branches that are disjoint with the supported environments.
(If the supported environments change, we ignore the lockfile entirely,
so we don't have to worry about any interactions between supported
environments and the preference forks.)

Closes https://github.com/astral-sh/uv/issues/6184.
This commit is contained in:
Charlie Marsh 2024-08-20 09:28:04 -04:00 committed by GitHub
parent d02c202eb2
commit 3395d24959
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 790 additions and 49 deletions

View file

@ -626,9 +626,9 @@ enum FastPathRev {
/// date with what this rev resolves to on GitHub's server.
UpToDate,
/// The following SHA must be fetched in order for the local rev to become
/// up to date.
/// up-to-date.
NeedsFetch(GitOid),
/// Don't know whether local rev is up to date. We'll fetch _all_ branches
/// Don't know whether local rev is up-to-date. We'll fetch _all_ branches
/// and tags from the server and see what happens.
Indeterminate,
}