mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
set UV_PYTHON_DOWNLOADS=auto when doing uv sync
This commit is contained in:
parent
208729fa3e
commit
24d1d17e6e
1 changed files with 2 additions and 16 deletions
|
|
@ -255,27 +255,13 @@ fn handle_version_install_or_update(state: &State, choice: MainMenuChoice) -> Re
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
// `uv sync` sometimes does not pull in Python automatically
|
|
||||||
// This might be system/platform specific and/or a uv bug.
|
|
||||||
let mut command = Command::new(&state.uv_path);
|
|
||||||
command
|
|
||||||
.current_dir(&state.uv_install_root)
|
|
||||||
.env("UV_CACHE_DIR", &state.uv_cache_dir)
|
|
||||||
.env("UV_PYTHON_INSTALL_DIR", &state.uv_python_install_dir)
|
|
||||||
.args(["python", "install", "--managed-python"]);
|
|
||||||
|
|
||||||
// Add python version if .python-version file exists
|
|
||||||
if let Some(version) = &python_version_trimmed {
|
|
||||||
command.args([version]);
|
|
||||||
}
|
|
||||||
|
|
||||||
command.ensure_success().context("Python install failed")?;
|
|
||||||
|
|
||||||
// Sync the venv
|
// Sync the venv
|
||||||
let mut command = Command::new(&state.uv_path);
|
let mut command = Command::new(&state.uv_path);
|
||||||
command
|
command
|
||||||
.current_dir(&state.uv_install_root)
|
.current_dir(&state.uv_install_root)
|
||||||
.env("UV_CACHE_DIR", &state.uv_cache_dir)
|
.env("UV_CACHE_DIR", &state.uv_cache_dir)
|
||||||
|
// We always want to download python, even if the user has their system set to 'never'
|
||||||
|
.env("UV_PYTHON_DOWNLOADS", "auto")
|
||||||
.env("UV_PYTHON_INSTALL_DIR", &state.uv_python_install_dir)
|
.env("UV_PYTHON_INSTALL_DIR", &state.uv_python_install_dir)
|
||||||
.args(["sync", "--upgrade", "--managed-python"]);
|
.args(["sync", "--upgrade", "--managed-python"]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue