Skip to content

Commit c445aa2

Browse files
committed
CI: Use uv run for first command
This automatically creates a local virtual environment.
1 parent 44a0f9a commit c445aa2

File tree

4 files changed

+59
-120
lines changed

4 files changed

+59
-120
lines changed

.github/workflows/documentation.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
fetch-depth: 0
2222

2323
- name: Copy build utils
24-
run: |
25-
cp -r .github/utils ../utils
24+
run: cp -r .github/utils ../utils
2625

2726
- name: Decide where to deploy and create output variables
2827
id: variables
@@ -49,42 +48,35 @@ jobs:
4948
- name: Checkout Code
5049
uses: actions/checkout@v4
5150

52-
- name: Install a specific version of uv
53-
uses: astral-sh/setup-uv@v3
51+
- name: Install uv and set python version
52+
uses: astral-sh/setup-uv@v6
5453
with:
55-
version: "latest"
56-
57-
- name: Create Virtual Environment
58-
run: uv venv --python ${{ matrix.python-version }}
54+
python-version: ${{ matrix.python-version }}
5955

6056
- name: Install Quarto
6157
uses: quarto-dev/quarto-actions/setup@v2
6258
with:
6359
version: pre-release
6460

65-
- name: Install Package
66-
shell: bash
67-
run: |
61+
- name: Install Documentation Dependencies
62+
run: |
63+
uv venv
6864
make doc-dependencies
6965
7066
- name: Environment Information
71-
shell: bash
7267
run: |
7368
ls -la
7469
ls -la doc
7570
uv pip list
7671
7772
- name: Build docs
78-
shell: bash
79-
run: |
80-
pushd doc; make doc; popd
73+
run: make doc
8174

8275
- name: Environment Information
83-
shell: bash
8476
run: |
8577
ls -la doc
86-
cat doc/_variables.yml
8778
ls -la doc/reference
79+
cat doc/_variables.yml
8880
8981
- name: Deploy to Documentation to a Branch
9082
uses: JamesIves/github-pages-deploy-action@v4

.github/workflows/release.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,19 @@ jobs:
2828
uses: actions/checkout@v4
2929

3030
- name: Install a specific version of uv
31-
uses: astral-sh/setup-uv@v3
31+
uses: astral-sh/setup-uv@v6
3232
with:
33-
version: "latest"
34-
35-
- name: Create Virtual Environment
36-
run: uv venv --python ${{ matrix.python-version }}
33+
python-version: ${{ matrix.python-version }}
3734

3835
- name: Copy build utils
39-
run: |
40-
cp -r .github/utils ../utils
36+
run: cp -r .github/utils ../utils
4137

4238
- name: Decide where to publish and create output variables
4339
id: variables
4440
run: uv run python ../utils/please.py set_publish_on
4541

4642
- name: See outputs
47-
shell: bash
48-
run: |
49-
echo "publish_on="${{ steps.variables.outputs.publish_on }}
43+
run: echo "publish_on="${{ steps.variables.outputs.publish_on }}
5044

5145
# Ref: https://github.com/pypa/gh-action-pypi-publish
5246
publish:
@@ -72,15 +66,12 @@ jobs:
7266
uses: actions/checkout@v4
7367

7468
- name: Install a specific version of uv
75-
uses: astral-sh/setup-uv@v3
69+
uses: astral-sh/setup-uv@v6
7670
with:
77-
version: "latest"
78-
79-
- name: Create Virtual Environment
80-
run: uv venv --python ${{ matrix.python-version }}
71+
python-version: ${{ matrix.python-version }}
8172

8273
- name: Install Packages
83-
run: uv pip install build
74+
run: uv run uv pip install build
8475

8576
- name: Build a wheel and a source tarball
8677
run: make dist

.github/workflows/testing.yml

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,24 @@ jobs:
3333
uses: actions/checkout@v4
3434

3535
- name: Install a specific version of uv
36-
uses: astral-sh/setup-uv@v3
36+
uses: astral-sh/setup-uv@v6
3737
with:
38-
version: "latest"
39-
40-
- name: Create Virtual Environment
41-
run: uv venv --python ${{ matrix.python-version }}
38+
python-version: ${{ matrix.python-version }}
4239

4340
- name: Install Packages
4441
run: |
4542
# Install as an editable so that the coverage path
4643
# is predicable
47-
uv pip install --resolution=${{ matrix.resolution }} -e ".[extra,test]"
44+
uv run uv pip install --resolution=${{ matrix.resolution }} -e ".[extra,test]"
4845
4946
- name: Environment Information
50-
run: |
51-
uv pip list
47+
run: uv pip list
5248

5349
- name: Run Tests
5450
run: make test
5551

5652
- name: List Directory
57-
run: |
58-
ls -la
53+
run: ls -la
5954

6055
- uses: actions/upload-artifact@v4
6156
if: failure()
@@ -90,28 +85,21 @@ jobs:
9085
uses: actions/checkout@v4
9186

9287
- name: Install a specific version of uv
93-
uses: astral-sh/setup-uv@v3
88+
uses: astral-sh/setup-uv@v6
9489
with:
95-
version: "latest"
96-
97-
- name: Create Virtual Environment
98-
run: uv venv --python ${{ matrix.python-version }}
90+
python-version: ${{ matrix.python-version }}
9991

10092
- name: Install Packages
101-
run: uv tool install ruff
93+
run: uv run uv pip install ruff
10294

10395
- name: Environment Information
10496
run: uv pip list
10597

10698
- name: Check lint with Ruff
107-
shell: bash
108-
run: |
109-
make lint
99+
run: make lint
110100

111101
- name: Check format with Ruff
112-
shell: bash
113-
run: |
114-
make format
102+
run: make format
115103

116104
typecheck:
117105
runs-on: ubuntu-latest
@@ -129,15 +117,12 @@ jobs:
129117
uses: actions/checkout@v4
130118

131119
- name: Install a specific version of uv
132-
uses: astral-sh/setup-uv@v3
120+
uses: astral-sh/setup-uv@v6
133121
with:
134-
version: "latest"
122+
python-version: ${{ matrix.python-version }}
135123

136-
- name: Create Virtual Environment
137-
run: uv venv --python ${{ matrix.python-version }}
138-
139124
- name: Install Packages
140-
run: uv pip install ".[extra, typing]"
125+
run: uv run uv pip install ".[extra, typing]"
141126

142127
- name: Environment Information
143128
run: uv pip list

.github/workflows/weekly.yml

Lines changed: 30 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,20 @@ jobs:
2020
uses: actions/checkout@v4
2121

2222
- name: Install a specific version of uv
23-
uses: astral-sh/setup-uv@v3
23+
uses: astral-sh/setup-uv@v6
2424
with:
25-
version: "latest"
26-
27-
- name: Create Virtual Environment
28-
run: uv venv --python ${{ matrix.python-version }}
25+
python-version: ${{ matrix.python-version }}
2926

3027
- name: Install Packages
3128
run: |
32-
uv pip install ".[extra,test]"
29+
uv run uv pip install ".[extra,test]"
3330
uv pip install --upgrade git+https://github.com/matplotlib/matplotlib
3431
3532
- name: Environment Information
36-
run: |
37-
uv pip list
33+
run: uv pip list
3834

3935
- name: Run Tests
40-
run: |
41-
make test
36+
run: make test
4237

4338
- uses: actions/upload-artifact@v4
4439
if: failure()
@@ -59,26 +54,22 @@ jobs:
5954
uses: actions/checkout@v4
6055

6156
- name: Install a specific version of uv
62-
uses: astral-sh/setup-uv@v3
57+
uses: astral-sh/setup-uv@v6
6358
with:
64-
version: "latest"
59+
python-version: ${{ matrix.python-version }}
6560

66-
- name: Create Virtual Environment
67-
run: uv venv --python ${{ matrix.python-version }}
6861

6962
- name: Install Packages
7063
run: |
71-
uv pip install ".[extra,test]"
64+
uv run uv pip install ".[extra,test]"
7265
uv pip install --upgrade git+https://github.com/pandas-dev/pandas
7366
7467
- name: Environment Information
75-
run: |
76-
uv pip list
68+
run: uv pip list
7769

7870
# to do: think about catching deprecations earlier
7971
- name: Run Tests
80-
run: |
81-
make test
72+
run: make test
8273

8374
- uses: actions/upload-artifact@v4
8475
if: failure()
@@ -110,25 +101,20 @@ jobs:
110101
ref: ${{ steps.latestrelease.outputs.latestrelease }}
111102

112103
- name: Install a specific version of uv
113-
uses: astral-sh/setup-uv@v3
104+
uses: astral-sh/setup-uv@v6
114105
with:
115-
version: "latest"
116-
117-
- name: Create Virtual Environment
118-
run: uv venv --python ${{ matrix.python-version }}
106+
python-version: ${{ matrix.python-version }}
119107

120108
- name: Install Packages
121109
run: |
122-
uv pip install --upgrade git+https://github.com/matplotlib/matplotlib
110+
uv run uv pip install --upgrade git+https://github.com/matplotlib/matplotlib
123111
uv pip install ".[extra,test]"
124112
125113
- name: Environment Information
126-
run: |
127-
uv pip list
114+
run: uv pip list
128115

129116
- name: Run Tests
130-
run: |
131-
make test
117+
run: make test
132118

133119
- uses: actions/upload-artifact@v4
134120
if: failure()
@@ -160,26 +146,21 @@ jobs:
160146
ref: ${{ steps.latestrelease.outputs.latestrelease }}
161147

162148
- name: Install a specific version of uv
163-
uses: astral-sh/setup-uv@v3
149+
uses: astral-sh/setup-uv@v6
164150
with:
165-
version: "latest"
166-
167-
- name: Create Virtual Environment
168-
run: uv venv --python ${{ matrix.python-version }}
151+
python-version: ${{ matrix.python-version }}
169152

170153
- name: Install Packages
171154
run: |
172-
uv pip install --upgrade git+https://github.com/pandas-dev/pandas
155+
uv run uv pip install --upgrade git+https://github.com/pandas-dev/pandas
173156
uv pip install ".[extra,test]"
174157
175158
- name: Environment Information
176-
run: |
177-
uv pip list
159+
run: uv pip list
178160

179161
# to do: think about catching deprecations earlier
180162
- name: Run Tests
181-
run: |
182-
make test
163+
run: make test
183164

184165
- uses: actions/upload-artifact@v4
185166
if: failure()
@@ -202,25 +183,20 @@ jobs:
202183
uses: actions/checkout@v4
203184

204185
- name: Install a specific version of uv
205-
uses: astral-sh/setup-uv@v3
186+
uses: astral-sh/setup-uv@v6
206187
with:
207-
version: "latest"
208-
209-
- name: Create Virtual Environment
210-
run: uv venv --python ${{ matrix.python-version }}
188+
python-version: ${{ matrix.python-version }}
211189

212190
- name: Install Packages
213191
run: |
214-
uv pip install ".[extra,typing]"
192+
uv run uv pip install ".[extra,typing]"
215193
uv pip install --upgrade git+https://github.com/matplotlib/matplotlib
216194
217195
- name: Environment Information
218-
run: |
219-
uv pip list
196+
run: uv pip list
220197

221198
- name: Run Tests
222-
run: |
223-
make typecheck
199+
run: make typecheck
224200

225201
# Should mark this as can fail when feature is implemented
226202
# https://github.com/actions/runner/issues/2347
@@ -236,26 +212,21 @@ jobs:
236212
uses: actions/checkout@v4
237213

238214
- name: Install a specific version of uv
239-
uses: astral-sh/setup-uv@v3
215+
uses: astral-sh/setup-uv@v6
240216
with:
241-
version: "latest"
242-
243-
- name: Create Virtual Environment
244-
run: uv venv --python ${{ matrix.python-version }}
217+
python-version: ${{ matrix.python-version }}
245218

246219
- name: Install Packages
247220
run: |
248-
uv pip install ".[extra,typing]"
221+
uv run uv pip install ".[extra,typing]"
249222
uv pip install --upgrade git+https://github.com/pandas-dev/pandas
250223
251224
- name: Environment Information
252-
run: |
253-
uv pip list
225+
run: uv pip list
254226

255227
# to do: think about catching deprecations earlier
256228
- name: Run Tests
257-
run: |
258-
make typecheck
229+
run: make typecheck
259230

260231
- uses: actions/upload-artifact@v4
261232
if: failure()

0 commit comments

Comments
 (0)