From 5f8bfe19d8100c3d1ede6e27a204065b28d03d2a Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Fri, 6 Feb 2026 10:43:31 +0100 Subject: [PATCH] fix: use --clear to create venv --- dist/setup/index.js | 8 +++++++- src/setup-uv.ts | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index df8013e..c664ef4 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -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`; diff --git a/src/setup-uv.ts b/src/setup-uv.ts index ce556af..f81f125 100644 --- a/src/setup-uv.ts +++ b/src/setup-uv.ts @@ -272,7 +272,13 @@ async function activateEnvironment(): Promise { } 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") {