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

@ -305,7 +305,7 @@ impl ManagedPythonInstallation {
pub fn satisfies(&self, request: &PythonRequest) -> bool {
match request {
PythonRequest::File(path) => self.executable() == *path,
PythonRequest::Default => true,
PythonRequest::Default | PythonRequest::Any => true,
PythonRequest::Directory(path) => self.path() == *path,
PythonRequest::ExecutableName(name) => self
.executable()