Skip to content

Commit 0457500

Browse files
committed
Ignore . prefixed directories during managed Python installation discovery
1 parent 459269f commit 0457500

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

crates/uv-python/src/managed.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,18 @@ impl ManagedPythonInstallations {
211211
})
212212
}
213213
};
214-
let cache = self.scratch();
214+
let scratch = self.scratch();
215215
Ok(dirs
216216
.into_iter()
217-
.filter(|path| *path != cache)
217+
// Ignore the scratch directory
218+
.filter(|path| *path != scratch)
219+
// Ignore any `.` prefixed directories
220+
.filter(|path| {
221+
path.file_name()
222+
.and_then(OsStr::to_str)
223+
.map(|name| name.starts_with('.'))
224+
.unwrap_or(true)
225+
})
218226
.filter_map(|path| {
219227
ManagedPythonInstallation::new(path)
220228
.inspect_err(|err| {

0 commit comments

Comments
 (0)