Omit variant when detecting compatible Python installs (#10722)

## Summary

Closes https://github.com/astral-sh/uv/issues/10586.
This commit is contained in:
Charlie Marsh 2025-01-21 10:01:18 -05:00 committed by GitHub
parent 7a14ea639e
commit 9799048f92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -242,16 +242,16 @@ impl ManagedPythonInstallations {
pub fn find_matching_current_platform( pub fn find_matching_current_platform(
&self, &self,
) -> Result<impl DoubleEndedIterator<Item = ManagedPythonInstallation>, Error> { ) -> Result<impl DoubleEndedIterator<Item = ManagedPythonInstallation>, Error> {
let platform_key = platform_key_from_env()?; let os = Os::from_env();
let arch = Arch::from_env();
let libc = Libc::from_env()?;
let iter = ManagedPythonInstallations::from_settings(None)? let iter = ManagedPythonInstallations::from_settings(None)?
.find_all()? .find_all()?
.filter(move |installation| { .filter(move |installation| {
installation installation.key.os == os
.path && installation.key.arch.family == arch.family
.file_name() && installation.key.libc == libc
.map(OsStr::to_string_lossy)
.is_some_and(|filename| filename.ends_with(&platform_key))
}); });
Ok(iter) Ok(iter)