Recreate pyenv if it was created with uv

Temporary fix for #4074 breaking normal builds
This commit is contained in:
Damien Elmes 2025-06-12 12:20:02 +07:00
parent 22f4a83222
commit e728e8bcb1

View file

@ -27,6 +27,13 @@ pub fn setup_pyenv(args: PyenvArgs) {
let pyenv_python = pyenv_bin_folder.join("python"); let pyenv_python = pyenv_bin_folder.join("python");
let pip_sync = pyenv_bin_folder.join("pip-sync"); let pip_sync = pyenv_bin_folder.join("pip-sync");
// Ensure the venv gets recreated properly if it was created by our uv branch
let cache_tag = pyenv_folder.join("CACHEDIR.TAG");
if cache_tag.exists() {
println!("Cleaning up uv pyenv...");
std::fs::remove_dir_all(pyenv_folder).expect("Failed to remove pyenv folder");
}
if !pyenv_python.exists() { if !pyenv_python.exists() {
run_command( run_command(
Command::new(&args.python_bin) Command::new(&args.python_bin)