Skip to content

Commit d4b2f3b

Browse files
authored
Make sure uv installed by setup-uv is first in PATH (#373)
Fixes: #372
1 parent 594f292 commit d4b2f3b

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ jobs:
6666
working-directory: __tests__/fixtures/uv-project
6767

6868
test-semver-range:
69-
runs-on: ubuntu-latest
69+
strategy:
70+
matrix:
71+
os: [ ubuntu-latest, selfhosted-ubuntu-arm64 ]
72+
runs-on: ${{ matrix.os }}
7073
steps:
7174
- uses: actions/checkout@v4
7275
- name: Install version 0.3
@@ -75,6 +78,12 @@ jobs:
7578
with:
7679
version: "0.3"
7780
- name: Correct version gets installed
81+
run: |
82+
if [ "$(uv --version)" != "uv 0.3.5" ]; then
83+
echo "Wrong uv version: $(uv --version)"
84+
exit 1
85+
fi
86+
- name: Output has correct version
7887
run: |
7988
if [ "$UV_VERSION" != "0.3.5" ]; then
8089
exit 1
@@ -93,11 +102,10 @@ jobs:
93102
version: ">=0.4.25,<0.5"
94103
- name: Correct version gets installed
95104
run: |
96-
if [ "$UV_VERSION" != "0.4.30" ]; then
105+
if [ "$(uv --version)" != "uv 0.4.30" ]; then
106+
echo "Wrong uv version: $(uv --version)"
97107
exit 1
98108
fi
99-
env:
100-
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
101109
102110
test-pyproject-file-version:
103111
runs-on: ubuntu-latest
@@ -110,11 +118,10 @@ jobs:
110118
pyproject-file: "__tests__/fixtures/pyproject-toml-project/pyproject.toml"
111119
- name: Correct version gets installed
112120
run: |
113-
if [ "$UV_VERSION" != "0.5.14" ]; then
121+
if [ "$(uv --version)" != "uv 0.5.14" ]; then
122+
echo "Wrong uv version: $(uv --version)"
114123
exit 1
115124
fi
116-
env:
117-
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
118125
119126
test-malformed-pyproject-file-fallback:
120127
runs-on: ubuntu-latest
@@ -140,11 +147,10 @@ jobs:
140147
uv-file: "__tests__/fixtures/uv-toml-project/uv.toml"
141148
- name: Correct version gets installed
142149
run: |
143-
if [ "$UV_VERSION" != "0.5.15" ]; then
150+
if [ "$(uv --version)" != "uv 0.5.15" ]; then
151+
echo "Wrong uv version: $(uv --version)"
144152
exit 1
145153
fi
146-
env:
147-
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
148154
149155
test-checksum:
150156
runs-on: ${{ matrix.inputs.os }}

dist/setup/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup-uv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ async function run(): Promise<void> {
4444
}
4545
const setupResult = await setupUv(platform, arch, checkSum, githubToken);
4646

47-
addUvToPathAndOutput(setupResult.uvDir);
4847
addToolBinToPath();
48+
addUvToPathAndOutput(setupResult.uvDir);
4949
setToolDir();
5050
await setupPython();
5151
addMatchers();

0 commit comments

Comments
 (0)