mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-10-18 08:37:01 +00:00
committed by
GitHub
parent
1a91c3851d
commit
bd1f875aba
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -334,6 +334,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install latest version
|
||||
id: setup-uv
|
||||
uses: ./
|
||||
with:
|
||||
python-version: 3.13.1t
|
||||
@@ -348,6 +349,19 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
- name: Verify output venv is set
|
||||
run: |
|
||||
if [ -z "$UV_VENV" ]; then
|
||||
echo "output venv is not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$UV_VENV" ]; then
|
||||
echo "output venv not point to a directory: $UV_VENV"
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
env:
|
||||
UV_VENV: ${{ steps.setup-uv.outputs.venv }}
|
||||
|
||||
test-musl:
|
||||
runs-on: ubuntu-latest
|
||||
|
@@ -86,6 +86,8 @@ outputs:
|
||||
description: "The path to the installed uvx binary."
|
||||
cache-hit:
|
||||
description: "A boolean value to indicate a cache entry was found"
|
||||
venv:
|
||||
description: "Path to the activated venv if activate-environment is true"
|
||||
runs:
|
||||
using: "node24"
|
||||
main: "dist/setup/index.js"
|
||||
|
8
dist/setup/index.js
generated
vendored
8
dist/setup/index.js
generated
vendored
@@ -129661,12 +129661,14 @@ async function activateEnvironment() {
|
||||
const execArgs = ["venv", ".venv", "--directory", inputs_1.workingDirectory];
|
||||
core.info("Activating python venv...");
|
||||
await exec.exec("uv", execArgs);
|
||||
let venvBinPath = `${inputs_1.workingDirectory}${path.sep}.venv${path.sep}bin`;
|
||||
const venvPath = path.resolve(`${inputs_1.workingDirectory}${path.sep}.venv`);
|
||||
let venvBinPath = `${venvPath}${path.sep}bin`;
|
||||
if (process.platform === "win32") {
|
||||
venvBinPath = `${inputs_1.workingDirectory}${path.sep}.venv${path.sep}Scripts`;
|
||||
venvBinPath = `${venvPath}${path.sep}Scripts`;
|
||||
}
|
||||
core.addPath(path.resolve(venvBinPath));
|
||||
core.exportVariable("VIRTUAL_ENV", path.resolve(`${inputs_1.workingDirectory}${path.sep}.venv`));
|
||||
core.exportVariable("VIRTUAL_ENV", venvPath);
|
||||
core.setOutput("venv", venvPath);
|
||||
}
|
||||
}
|
||||
function setCacheDir() {
|
||||
|
@@ -213,15 +213,14 @@ async function activateEnvironment(): Promise<void> {
|
||||
core.info("Activating python venv...");
|
||||
await exec.exec("uv", execArgs);
|
||||
|
||||
let venvBinPath = `${workingDirectory}${path.sep}.venv${path.sep}bin`;
|
||||
const venvPath = path.resolve(`${workingDirectory}${path.sep}.venv`);
|
||||
let venvBinPath = `${venvPath}${path.sep}bin`;
|
||||
if (process.platform === "win32") {
|
||||
venvBinPath = `${workingDirectory}${path.sep}.venv${path.sep}Scripts`;
|
||||
venvBinPath = `${venvPath}${path.sep}Scripts`;
|
||||
}
|
||||
core.addPath(path.resolve(venvBinPath));
|
||||
core.exportVariable(
|
||||
"VIRTUAL_ENV",
|
||||
path.resolve(`${workingDirectory}${path.sep}.venv`),
|
||||
);
|
||||
core.exportVariable("VIRTUAL_ENV", venvPath);
|
||||
core.setOutput("venv", venvPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user