Add value of UV_PYTHON_INSTALL_DIR to path (#628)

Closes: #610
This commit is contained in:
Kevin Stillhammer
2025-10-11 18:42:06 +02:00
committed by GitHub
parent bd1f875aba
commit d18bcc753a
7 changed files with 112 additions and 49 deletions

View File

@@ -19,6 +19,7 @@ import {
githubToken,
ignoreEmptyWorkdir,
manifestFile,
pythonDir,
pythonVersion,
toolBinDir,
toolDir,
@@ -51,6 +52,7 @@ async function run(): Promise<void> {
addToolBinToPath();
addUvToPathAndOutput(setupResult.uvDir);
setToolDir();
addPythonDirToPath();
setupPython();
await activateEnvironment();
addMatchers();
@@ -194,6 +196,17 @@ function setToolDir(): void {
}
}
function addPythonDirToPath(): void {
core.exportVariable("UV_PYTHON_INSTALL_DIR", pythonDir);
core.info(`Set UV_PYTHON_INSTALL_DIR to ${pythonDir}`);
if (process.env.UV_NO_MODIFY_PATH !== undefined) {
core.info("UV_NO_MODIFY_PATH is set, not adding python dir to path");
} else {
core.addPath(pythonDir);
core.info(`Added ${pythonDir} to the path`);
}
}
function setupPython(): void {
if (pythonVersion !== "") {
core.exportVariable("UV_PYTHON", pythonVersion);