Skip installing --with requirements if present in base environment (#4879)

## Summary

Closes #4547.
This commit is contained in:
Charlie Marsh 2024-07-07 20:23:59 -05:00 committed by GitHub
parent a76d04b159
commit 98a720ec08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 184 additions and 47 deletions

View file

@ -177,26 +177,7 @@ impl PythonEnvironment {
/// Some distributions also create symbolic links from `purelib` to `platlib`; in such cases, we
/// still deduplicate the entries, returning a single path.
pub fn site_packages(&self) -> impl Iterator<Item = Cow<Path>> {
let target = self.0.interpreter.target().map(Target::site_packages);
let prefix = self
.0
.interpreter
.prefix()
.map(|prefix| prefix.site_packages(self.0.interpreter.virtualenv()));
let interpreter = if target.is_none() && prefix.is_none() {
Some(self.0.interpreter.site_packages())
} else {
None
};
target
.into_iter()
.flatten()
.map(Cow::Borrowed)
.chain(prefix.into_iter().flatten().map(Cow::Owned))
.chain(interpreter.into_iter().flatten().map(Cow::Borrowed))
self.0.interpreter.site_packages()
}
/// Returns the path to the `bin` directory inside this environment.