mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-05-17 14:44:46 +00:00
parent
85aa0bf0c1
commit
dd578776bb
5 changed files with 62 additions and 18 deletions
25
dist/setup/index.js
generated
vendored
25
dist/setup/index.js
generated
vendored
|
@ -99236,6 +99236,7 @@ const download_version_1 = __nccwpck_require__(8255);
|
|||
const restore_cache_1 = __nccwpck_require__(7772);
|
||||
const platforms_1 = __nccwpck_require__(8361);
|
||||
const inputs_1 = __nccwpck_require__(9612);
|
||||
const exec = __importStar(__nccwpck_require__(5236));
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const platform = (0, platforms_1.getPlatform)();
|
||||
|
@ -99251,7 +99252,7 @@ function run() {
|
|||
addUvToPath(setupResult.uvDir);
|
||||
addToolBinToPath();
|
||||
setToolDir();
|
||||
setupPython();
|
||||
yield setupPython();
|
||||
addMatchers();
|
||||
setCacheDir(inputs_1.cacheLocalPath);
|
||||
core.setOutput("uv-version", setupResult.version);
|
||||
|
@ -99317,10 +99318,24 @@ function setToolDir() {
|
|||
}
|
||||
}
|
||||
function setupPython() {
|
||||
if (inputs_1.pythonVersion !== "") {
|
||||
core.exportVariable("UV_PYTHON", inputs_1.pythonVersion);
|
||||
core.info(`Set UV_PYTHON to ${inputs_1.pythonVersion}`);
|
||||
}
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (inputs_1.pythonVersion !== "") {
|
||||
core.exportVariable("UV_PYTHON", inputs_1.pythonVersion);
|
||||
core.info(`Set UV_PYTHON to ${inputs_1.pythonVersion}`);
|
||||
const options = {
|
||||
silent: !core.isDebug(),
|
||||
};
|
||||
const execArgs = ["venv", "--python", inputs_1.pythonVersion];
|
||||
core.info("Activating python venv...");
|
||||
yield exec.exec("uv", execArgs, options);
|
||||
let venvBinPath = ".venv/bin";
|
||||
if (process.platform === "win32") {
|
||||
venvBinPath = ".venv/Scripts";
|
||||
}
|
||||
core.addPath(venvBinPath);
|
||||
core.exportVariable("VIRTUAL_ENV", venvBinPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
function setCacheDir(cacheLocalPath) {
|
||||
core.exportVariable("UV_CACHE_DIR", cacheLocalPath);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue