fix: use --clear to create venv (#761)

Fixes: https://github.com/astral-sh/setup-uv/issues/758
This commit is contained in:
Kevin Stillhammer
2026-02-06 10:48:26 +01:00
committed by GitHub
parent b6b8e2cd6a
commit 78cebeceac
2 changed files with 14 additions and 2 deletions

8
dist/setup/index.js generated vendored
View File

@@ -96569,7 +96569,13 @@ async function activateEnvironment() {
throw new Error("UV_NO_MODIFY_PATH and activate-environment cannot be used together.");
}
core.info(`Creating and activating python venv at ${inputs_1.venvPath}...`);
await exec.exec("uv", ["venv", inputs_1.venvPath, "--directory", inputs_1.workingDirectory]);
await exec.exec("uv", [
"venv",
inputs_1.venvPath,
"--directory",
inputs_1.workingDirectory,
"--clear",
]);
let venvBinPath = `${inputs_1.venvPath}${path.sep}bin`;
if (process.platform === "win32") {
venvBinPath = `${inputs_1.venvPath}${path.sep}Scripts`;