Add new PythonRequest::Any and VersionRequest::Any variants (#7517)

Follow-up to https://github.com/astral-sh/uv/pull/7514 and #7526 adding
the `Any` variants again with slightly different semantics (i.e., they
allow pre-releases)

We'll be able to use this in https://github.com/astral-sh/uv/pull/7508
to avoid querying a bunch of alternative interpreters unnecessarily in
the non-list case.
This commit is contained in:
Zanie Blue 2024-09-19 06:19:13 -05:00 committed by GitHub
parent 0f9a2e3870
commit 09a2ebca8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 66 additions and 24 deletions

View file

@ -80,7 +80,7 @@ impl fmt::Display for EnvironmentNotFound {
EnvironmentPreference::OnlyVirtual => SearchType::Virtual,
};
if matches!(self.request, PythonRequest::Default) {
if matches!(self.request, PythonRequest::Default | PythonRequest::Any) {
write!(f, "No {search_type} found")?;
} else {
write!(f, "No {search_type} found for {}", self.request)?;