mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-04-16 08:30:10 +00:00
feat: add venv-path input for activate-environment
Allow customizing the venv location while preserving working-directory semantics via --directory.
This commit is contained in:
parent
98e1309028
commit
4b51b416f8
9 changed files with 151 additions and 15 deletions
|
|
@ -14,6 +14,7 @@ export const version = core.getInput("version");
|
|||
export const versionFile = getVersionFile();
|
||||
export const pythonVersion = core.getInput("python-version");
|
||||
export const activateEnvironment = core.getBooleanInput("activate-environment");
|
||||
export const venvPath = getVenvPath();
|
||||
export const checkSum = core.getInput("checksum");
|
||||
export const enableCache = getEnableCache();
|
||||
export const restoreCache = core.getInput("restore-cache") === "true";
|
||||
|
|
@ -45,6 +46,15 @@ function getVersionFile(): string {
|
|||
return versionFileInput;
|
||||
}
|
||||
|
||||
function getVenvPath(): string {
|
||||
const venvPathInput = core.getInput("venv-path");
|
||||
if (venvPathInput !== "") {
|
||||
const tildeExpanded = expandTilde(venvPathInput);
|
||||
return resolveRelativePath(tildeExpanded);
|
||||
}
|
||||
return resolveRelativePath(".venv");
|
||||
}
|
||||
|
||||
function getEnableCache(): boolean {
|
||||
const enableCacheInput = core.getInput("enable-cache");
|
||||
if (enableCacheInput === "auto") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue