address review comments

Signed-off-by: Eli Uriegas <eliuriegas@meta.com>
This commit is contained in:
Eli Uriegas 2026-01-21 10:45:25 -08:00
parent c19391797c
commit 7b7b7ab303
2 changed files with 11 additions and 5 deletions

7
dist/setup/index.js generated vendored
View file

@ -96491,13 +96491,16 @@ function setupPython() {
core.info(`Set UV_PYTHON to ${inputs_1.pythonVersion}`);
}
}
function getVenvPath() {
// Use custom venv path if provided, otherwise default to .venv in working directory
return inputs_1.venvPath ?? path.resolve(`${inputs_1.workingDirectory}${path.sep}.venv`);
}
async function activateEnvironment() {
if (inputs_1.activateEnvironment) {
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
throw new Error("UV_NO_MODIFY_PATH and activate-environment cannot be used together.");
}
// Use custom venv path if provided, otherwise default to .venv in working directory
const venvPath = inputs_1.venvPath ?? path.resolve(`${inputs_1.workingDirectory}${path.sep}.venv`);
const venvPath = getVenvPath();
core.info(`Activating python venv at ${venvPath}...`);
await exec.exec("uv", ["venv", venvPath]);
let venvBinPath = `${venvPath}${path.sep}bin`;

View file

@ -263,6 +263,11 @@ function setupPython(): void {
}
}
function getVenvPath(): string {
// Use custom venv path if provided, otherwise default to .venv in working directory
return venvPathInput ?? path.resolve(`${workingDirectory}${path.sep}.venv`);
}
async function activateEnvironment(): Promise<void> {
if (activateEnvironmentInput) {
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
@ -271,9 +276,7 @@ async function activateEnvironment(): Promise<void> {
);
}
// Use custom venv path if provided, otherwise default to .venv in working directory
const venvPath =
venvPathInput ?? path.resolve(`${workingDirectory}${path.sep}.venv`);
const venvPath = getVenvPath();
core.info(`Activating python venv at ${venvPath}...`);
await exec.exec("uv", ["venv", venvPath]);