mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-02-07 18:17:24 +00:00
address review comments
Signed-off-by: Eli Uriegas <eliuriegas@meta.com>
This commit is contained in:
parent
c19391797c
commit
7b7b7ab303
2 changed files with 11 additions and 5 deletions
7
dist/setup/index.js
generated
vendored
7
dist/setup/index.js
generated
vendored
|
|
@ -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`;
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue