mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-31 17:13:45 +00:00
Add support for managed installs of free-threaded Python (#8100)
Closes https://github.com/astral-sh/uv/issues/7193 ``` ❯ cargo run -q -- python uninstall 3.13t Searching for Python versions matching: Python 3.13t Uninstalled Python 3.13.0 in 231ms - cpython-3.13.0+freethreaded-macos-aarch64-none ❯ cargo run -q -- python install 3.13t Searching for Python versions matching: Python 3.13t Installed Python 3.13.0 in 3.54s + cpython-3.13.0+freethreaded-macos-aarch64-none ❯ cargo run -q -- python install 3.12t Searching for Python versions matching: Python 3.12t error: No download found for request: cpython-3.12t-macos-aarch64-none ❯ cargo run -q -- python install 3.13rc3t Searching for Python versions matching: Python 3.13rc3t Found existing installation for Python 3.13rc3t: cpython-3.13.0+freethreaded-macos-aarch64-none ❯ cargo run -q -- run -p 3.13t python -c "import sys; print(sys.base_prefix)" /Users/zb/.local/share/uv/python/cpython-3.13.0+freethreaded-macos-aarch64-none ```
This commit is contained in:
parent
db0f0aec09
commit
5f33915e03
12 changed files with 6319 additions and 4211 deletions
|
@ -20,7 +20,7 @@ use crate::libc::LibcDetectionError;
|
|||
use crate::platform::Error as PlatformError;
|
||||
use crate::platform::{Arch, Libc, Os};
|
||||
use crate::python_version::PythonVersion;
|
||||
use crate::PythonRequest;
|
||||
use crate::{PythonRequest, PythonVariant};
|
||||
use uv_fs::{LockedFile, Simplified};
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
|
@ -329,13 +329,17 @@ impl ManagedPythonInstallation {
|
|||
let stdlib = if matches!(self.key.os, Os(target_lexicon::OperatingSystem::Windows)) {
|
||||
self.python_dir().join("Lib")
|
||||
} else {
|
||||
let lib_suffix = match self.key.variant {
|
||||
PythonVariant::Default => "",
|
||||
PythonVariant::Freethreaded => "t",
|
||||
};
|
||||
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())
|
||||
format!("python{}{lib_suffix}", self.key.version().python_version())
|
||||
};
|
||||
self.python_dir().join("lib").join(python)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue