mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Ignore .
prefixed directories during managed Python installation discovery (#9786)
Addresses https://github.com/astral-sh/uv/pull/9756#discussion_r1878722112
This commit is contained in:
parent
7191865d52
commit
fd420db197
1 changed files with 10 additions and 2 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue