Skip to content

Commit 4e226a2

Browse files
committed
chore(ci): switch to uv fully
We were still using the actions/setup-python action, which does not properly support uv. We switch instead to `astral-sh/setup-uv` and use uv to manage Python version as well. Signed-off-by: JP-Ellis <[email protected]>
1 parent 4493567 commit 4e226a2

File tree

3 files changed

+97
-48
lines changed

3 files changed

+97
-48
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,18 @@ jobs:
5252
fetch-depth: 0
5353

5454
- name: Set up Python
55-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
55+
uses: astral-sh/setup-[email protected]
5656
with:
57-
python-version: ${{ env.STABLE_PYTHON_VERSION }}
58-
cache: pip
57+
enable-cache: true
58+
cache-dependency-glob: |
59+
**/pyproject.toml
60+
**/uv.lock
61+
62+
- name: Install Python
63+
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
5964

6065
- name: Install hatch
61-
run: pip install --upgrade hatch
66+
run: uv tool install hatch
6267

6368
- name: Create source distribution
6469
run: |
@@ -231,10 +236,19 @@ jobs:
231236
path: wheels
232237
merge-multiple: true
233238

234-
- name: Setup Python
235-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
239+
- name: Set up uv
240+
uses: astral-sh/setup-[email protected]
236241
with:
237-
python-version: ${{ env.STABLE_PYTHON_VERSION }}
242+
enable-cache: true
243+
cache-dependency-glob: |
244+
**/pyproject.toml
245+
**/uv.lock
246+
247+
- name: Install Python
248+
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
249+
250+
- name: Install commitizen
251+
run: uv tool install commitizen
238252

239253
- name: Update changelog
240254
id: changelog

.github/workflows/docs.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ jobs:
2727
with:
2828
fetch-depth: 0
2929

30-
- name: Set up Python
31-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
30+
- name: Set up uv
31+
uses: astral-sh/setup-[email protected]
3232
with:
33-
python-version: ${{ env.STABLE_PYTHON_VERSION }}
34-
cache: pip
33+
enable-cache: true
34+
cache-dependency-glob: |
35+
**/pyproject.toml
36+
**/uv.lock
37+
38+
- name: Install Python
39+
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
3540

3641
- name: Install Hatch
37-
run: pip install --upgrade hatch
42+
run: uv tool install hatch
3843

3944
- name: Build docs
4045
run: |

.github/workflows/test.yml

Lines changed: 66 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,19 @@ jobs:
8686
cd tests/v3/compatibility_suite
8787
patch -p1 -d definition < definition-update.diff
8888
89-
- name: Set up Python ${{ matrix.python-version }}
90-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
89+
- name: Set up uv
90+
uses: astral-sh/setup-[email protected]
9191
with:
92-
python-version: ${{ matrix.python-version }}
93-
cache: pip
92+
enable-cache: true
93+
cache-dependency-glob: |
94+
**/pyproject.toml
95+
**/uv.lock
96+
97+
- name: Install Python
98+
run: uv python install ${{ matrix.python-version }}
9499

95100
- name: Install Hatch
96-
run: pip install --upgrade hatch
101+
run: uv tool install hatch
97102

98103
- name: Ensure broker is live
99104
run: |
@@ -152,14 +157,19 @@ jobs:
152157
cd tests/v3/compatibility_suite
153158
patch -p1 -d definition < definition-update.diff
154159
155-
- name: Set up Python ${{ matrix.python-version }}
156-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
160+
- name: Set up uv
161+
uses: astral-sh/setup-[email protected]
157162
with:
158-
python-version: ${{ matrix.python-version }}
159-
cache: pip
163+
enable-cache: true
164+
cache-dependency-glob: |
165+
**/pyproject.toml
166+
**/uv.lock
167+
168+
- name: Install Python
169+
run: uv python install ${{ matrix.python-version }}
160170

161171
- name: Install Hatch
162-
run: pip install --upgrade hatch
172+
run: uv tool install hatch
163173

164174
- name: Run tests
165175
run: hatch run test
@@ -186,14 +196,19 @@ jobs:
186196
steps:
187197
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
188198

189-
- name: Set up Python 3
190-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
199+
- name: Set up uv
200+
uses: astral-sh/setup-[email protected]
191201
with:
192-
python-version: ${{ env.STABLE_PYTHON_VERSION }}
193-
cache: pip
202+
enable-cache: true
203+
cache-dependency-glob: |
204+
**/pyproject.toml
205+
**/uv.lock
206+
207+
- name: Install Python
208+
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
194209

195210
- name: Install Hatch
196-
run: pip install --upgrade hatch
211+
run: uv tool install hatch
197212

198213
- name: Ensure broker is live
199214
run: |
@@ -225,14 +240,19 @@ jobs:
225240
steps:
226241
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
227242

228-
- name: Set up Python
229-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
243+
- name: Set up uv
244+
uses: astral-sh/setup-[email protected]
230245
with:
231-
python-version: ${{ env.STABLE_PYTHON_VERSION }}
232-
cache: pip
246+
enable-cache: true
247+
cache-dependency-glob: |
248+
**/pyproject.toml
249+
**/uv.lock
250+
251+
- name: Install Python
252+
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
233253

234254
- name: Install Hatch
235-
run: pip install --upgrade hatch
255+
run: uv tool install hatch
236256

237257
- name: Format
238258
run: hatch run format
@@ -245,14 +265,19 @@ jobs:
245265
steps:
246266
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
247267

248-
- name: Set up Python
249-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
268+
- name: Set up uv
269+
uses: astral-sh/setup-[email protected]
250270
with:
251-
python-version: ${{ env.STABLE_PYTHON_VERSION }}
252-
cache: pip
271+
enable-cache: true
272+
cache-dependency-glob: |
273+
**/pyproject.toml
274+
**/uv.lock
275+
276+
- name: Install Python
277+
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
253278

254279
- name: Install Hatch
255-
run: pip install --upgrade hatch
280+
run: uv tool install hatch
256281

257282
- name: Format
258283
run: hatch run lint
@@ -265,14 +290,19 @@ jobs:
265290
steps:
266291
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
267292

268-
- name: Set up Python
269-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
293+
- name: Set up uv
294+
uses: astral-sh/setup-[email protected]
270295
with:
271-
python-version: ${{ env.STABLE_PYTHON_VERSION }}
272-
cache: pip
296+
enable-cache: true
297+
cache-dependency-glob: |
298+
**/pyproject.toml
299+
**/uv.lock
300+
301+
- name: Install Python
302+
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}
273303

274304
- name: Install Hatch
275-
run: pip install --upgrade hatch
305+
run: uv tool install hatch
276306

277307
- name: Format
278308
run: hatch run typecheck
@@ -283,18 +313,18 @@ jobs:
283313
runs-on: ubuntu-latest
284314

285315
steps:
286-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
316+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
287317

288-
- name: Spell Check Repo
289-
uses: crate-ci/typos@master
318+
- name: Spell Check Repo
319+
uses: crate-ci/typos@master
290320

291321
pre-commit:
292322
name: Pre-commit
293323

294324
runs-on: ubuntu-latest
295325

296326
steps:
297-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
327+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
298328

299-
- name: Run pre-commit
300-
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
329+
- name: Run pre-commit
330+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

0 commit comments

Comments
 (0)