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

View File

@@ -272,7 +272,13 @@ async function activateEnvironment(): Promise<void> {
}
core.info(`Creating and activating python venv at ${venvPath}...`);
await exec.exec("uv", ["venv", venvPath, "--directory", workingDirectory]);
await exec.exec("uv", [
"venv",
venvPath,
"--directory",
workingDirectory,
"--clear",
]);
let venvBinPath = `${venvPath}${path.sep}bin`;
if (process.platform === "win32") {