5
0
mirror of https://github.com/astral-sh/setup-uv.git synced 2025-12-19 11:04:08 +00:00

Make sure uv installed by setup-uv is first in PATH (#373)

Fixes: #372
This commit is contained in:
Kevin Stillhammer
2025-04-16 12:31:45 +02:00
committed by GitHub
parent 594f292eef
commit e0671e8813
3 changed files with 18 additions and 12 deletions

View File

@@ -66,7 +66,10 @@ jobs:
working-directory: __tests__/fixtures/uv-project working-directory: __tests__/fixtures/uv-project
test-semver-range: test-semver-range:
runs-on: ubuntu-latest strategy:
matrix:
os: [ ubuntu-latest, selfhosted-ubuntu-arm64 ]
runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install version 0.3 - name: Install version 0.3
@@ -75,6 +78,12 @@ jobs:
with: with:
version: "0.3" version: "0.3"
- name: Correct version gets installed - name: Correct version gets installed
run: |
if [ "$(uv --version)" != "uv 0.3.5" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1
fi
- name: Output has correct version
run: | run: |
if [ "$UV_VERSION" != "0.3.5" ]; then if [ "$UV_VERSION" != "0.3.5" ]; then
exit 1 exit 1
@@ -93,11 +102,10 @@ jobs:
version: ">=0.4.25,<0.5" version: ">=0.4.25,<0.5"
- name: Correct version gets installed - name: Correct version gets installed
run: | run: |
if [ "$UV_VERSION" != "0.4.30" ]; then if [ "$(uv --version)" != "uv 0.4.30" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1 exit 1
fi fi
env:
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
test-pyproject-file-version: test-pyproject-file-version:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -110,11 +118,10 @@ jobs:
pyproject-file: "__tests__/fixtures/pyproject-toml-project/pyproject.toml" pyproject-file: "__tests__/fixtures/pyproject-toml-project/pyproject.toml"
- name: Correct version gets installed - name: Correct version gets installed
run: | run: |
if [ "$UV_VERSION" != "0.5.14" ]; then if [ "$(uv --version)" != "uv 0.5.14" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1 exit 1
fi fi
env:
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
test-malformed-pyproject-file-fallback: test-malformed-pyproject-file-fallback:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -140,11 +147,10 @@ jobs:
uv-file: "__tests__/fixtures/uv-toml-project/uv.toml" uv-file: "__tests__/fixtures/uv-toml-project/uv.toml"
- name: Correct version gets installed - name: Correct version gets installed
run: | run: |
if [ "$UV_VERSION" != "0.5.15" ]; then if [ "$(uv --version)" != "uv 0.5.15" ]; then
echo "Wrong uv version: $(uv --version)"
exit 1 exit 1
fi fi
env:
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
test-checksum: test-checksum:
runs-on: ${{ matrix.inputs.os }} runs-on: ${{ matrix.inputs.os }}

2
dist/setup/index.js generated vendored
View File

@@ -124294,8 +124294,8 @@ async function run() {
throw new Error(`Unsupported architecture: ${process.arch}`); throw new Error(`Unsupported architecture: ${process.arch}`);
} }
const setupResult = await setupUv(platform, arch, inputs_1.checkSum, inputs_1.githubToken); const setupResult = await setupUv(platform, arch, inputs_1.checkSum, inputs_1.githubToken);
addUvToPathAndOutput(setupResult.uvDir);
addToolBinToPath(); addToolBinToPath();
addUvToPathAndOutput(setupResult.uvDir);
setToolDir(); setToolDir();
await setupPython(); await setupPython();
addMatchers(); addMatchers();

View File

@@ -44,8 +44,8 @@ async function run(): Promise<void> {
} }
const setupResult = await setupUv(platform, arch, checkSum, githubToken); const setupResult = await setupUv(platform, arch, checkSum, githubToken);
addUvToPathAndOutput(setupResult.uvDir);
addToolBinToPath(); addToolBinToPath();
addUvToPathAndOutput(setupResult.uvDir);
setToolDir(); setToolDir();
await setupPython(); await setupPython();
addMatchers(); addMatchers();