mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-12 13:36:20 +00:00
Add PyPy finder (#5337)
## Summary This PR adds PyPy finder and adds PyPy to uv managed Python versions. ## Test Plan ```console $ cargo run -- python install ```
This commit is contained in:
parent
96b24345eb
commit
7ddf67a72b
7 changed files with 2948 additions and 23 deletions
File diff suppressed because it is too large
Load diff
|
@ -314,15 +314,23 @@ impl ManagedPythonInstallation {
|
|||
/// standard `EXTERNALLY-MANAGED` file.
|
||||
pub fn ensure_externally_managed(&self) -> Result<(), Error> {
|
||||
// Construct the path to the `stdlib` directory.
|
||||
let stdlib = if cfg!(windows) {
|
||||
let stdlib = if matches!(self.key.os, Os(target_lexicon::OperatingSystem::Windows)) {
|
||||
self.python_dir().join("Lib")
|
||||
} else {
|
||||
self.python_dir()
|
||||
.join("lib")
|
||||
.join(format!("python{}", self.key.version().python_version()))
|
||||
let python = if matches!(
|
||||
self.key.implementation,
|
||||
LenientImplementationName::Known(ImplementationName::PyPy)
|
||||
) {
|
||||
format!("pypy{}", self.key.version().python_version())
|
||||
} else {
|
||||
format!("python{}", self.key.version().python_version())
|
||||
};
|
||||
self.python_dir().join("lib").join(python)
|
||||
};
|
||||
|
||||
let file = stdlib.join("EXTERNALLY-MANAGED");
|
||||
fs_err::write(file, EXTERNALLY_MANAGED)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue