From c4748d675953425983b2d51c202d1fe305d93099 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 10 Dec 2024 14:07:36 -0600 Subject: [PATCH] Ignore `.` prefixed directories during managed Python installation discovery --- crates/uv-python/src/managed.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/uv-python/src/managed.rs b/crates/uv-python/src/managed.rs index a282cbda6a1e..67484ad97a35 100644 --- a/crates/uv-python/src/managed.rs +++ b/crates/uv-python/src/managed.rs @@ -211,10 +211,18 @@ impl ManagedPythonInstallations { }) } }; - let cache = self.scratch(); + let scratch = self.scratch(); Ok(dirs .into_iter() - .filter(|path| *path != cache) + // Ignore the scratch directory + .filter(|path| *path != scratch) + // Ignore any `.` prefixed directories + .filter(|path| { + path.file_name() + .and_then(OsStr::to_str) + .map(|name| !name.starts_with('.')) + .unwrap_or(true) + }) .filter_map(|path| { ManagedPythonInstallation::new(path) .inspect_err(|err| {