Skip to content

Commit

Permalink
Ignore . prefixed directories during managed Python installation di…
Browse files Browse the repository at this point in the history
…scovery (#9786)

Addresses
#9756 (comment)
  • Loading branch information
zanieb authored Dec 10, 2024
1 parent 7191865 commit fd420db
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/uv-python/src/managed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down

0 comments on commit fd420db

Please sign in to comment.