Skip to content

Commit 93174c0

Browse files
committed
CI: Use python from uv and a local virtualenv
1 parent 88b6385 commit 93174c0

File tree

5 files changed

+29
-92
lines changed

5 files changed

+29
-92
lines changed

.github/workflows/documentation.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,13 @@ jobs:
4949
- name: Checkout Code
5050
uses: actions/checkout@v4
5151

52-
- name: Setup Python
53-
uses: actions/setup-python@v5
54-
with:
55-
python-version: ${{ matrix.python-version }}
56-
5752
- name: Install a specific version of uv
5853
uses: astral-sh/setup-uv@v3
5954
with:
6055
version: "latest"
6156

62-
- name: Make uv use system python
63-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
57+
- name: Create Virtual Environment
58+
run: uv venv --python ${{ matrix.python-version }}
6459

6560
- name: Install Quarto
6661
uses: quarto-dev/quarto-actions/setup@v2

.github/workflows/release.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,21 @@ jobs:
2727
- name: Checkout Code
2828
uses: actions/checkout@v4
2929

30-
- name: Setup Python
31-
uses: actions/setup-python@v5
32-
with:
33-
python-version: ${{ matrix.python-version }}
34-
3530
- name: Install a specific version of uv
3631
uses: astral-sh/setup-uv@v3
3732
with:
3833
version: "latest"
3934

40-
- name: Make uv use system python
41-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
35+
- name: Create Virtual Environment
36+
run: uv venv --python ${{ matrix.python-version }}
4237

4338
- name: Copy build utils
4439
run: |
4540
cp -r .github/utils ../utils
4641
4742
- name: Decide where to publish and create output variables
4843
id: variables
49-
run: python ../utils/please.py set_publish_on
44+
run: uv run python ../utils/please.py set_publish_on
5045

5146
- name: See outputs
5247
shell: bash
@@ -76,18 +71,13 @@ jobs:
7671
- name: Checkout Code
7772
uses: actions/checkout@v4
7873

79-
- name: Setup Python
80-
uses: actions/setup-python@v5
81-
with:
82-
python-version: ${{ matrix.python-version }}
83-
8474
- name: Install a specific version of uv
8575
uses: astral-sh/setup-uv@v3
8676
with:
8777
version: "latest"
8878

89-
- name: Make uv use system python
90-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
79+
- name: Create Virtual Environment
80+
run: uv venv --python ${{ matrix.python-version }}
9181

9282
- name: Install Packages
9383
run: uv pip install build

.github/workflows/testing.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,13 @@ jobs:
3232
- name: Checkout Code
3333
uses: actions/checkout@v4
3434

35-
- name: Setup Python
36-
uses: actions/setup-python@v5
37-
with:
38-
python-version: ${{ matrix.python-version }}
39-
4035
- name: Install a specific version of uv
4136
uses: astral-sh/setup-uv@v3
4237
with:
4338
version: "latest"
4439

45-
- name: Make uv use system python
46-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
40+
- name: Create Virtual Environment
41+
run: uv venv --python ${{ matrix.python-version }}
4742

4843
- name: Install Packages
4944
run: |
@@ -56,9 +51,7 @@ jobs:
5651
uv pip list
5752
5853
- name: Run Tests
59-
run: |
60-
coverage erase
61-
make test
54+
run: make test
6255

6356
- name: List Directory
6457
run: |
@@ -96,18 +89,13 @@ jobs:
9689
- name: Checkout Code
9790
uses: actions/checkout@v4
9891

99-
- name: Setup Python
100-
uses: actions/setup-python@v5
101-
with:
102-
python-version: ${{ matrix.python-version }}
103-
10492
- name: Install a specific version of uv
10593
uses: astral-sh/setup-uv@v3
10694
with:
10795
version: "latest"
10896

109-
- name: Make uv use system python
110-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
97+
- name: Create Virtual Environment
98+
run: uv venv --python ${{ matrix.python-version }}
11199

112100
- name: Install Packages
113101
run: uv tool install ruff
@@ -140,22 +128,16 @@ jobs:
140128
- name: Checkout Code
141129
uses: actions/checkout@v4
142130

143-
- name: Setup Python
144-
uses: actions/setup-python@v5
145-
with:
146-
python-version: ${{ matrix.python-version }}
147-
148131
- name: Install a specific version of uv
149132
uses: astral-sh/setup-uv@v3
150133
with:
151134
version: "latest"
152135

153-
- name: Make uv use system python
154-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
155-
136+
- name: Create Virtual Environment
137+
run: uv venv --python ${{ matrix.python-version }}
138+
156139
- name: Install Packages
157-
run: |
158-
uv pip install ".[extra, typing]"
140+
run: uv pip install ".[extra, typing]"
159141

160142
- name: Environment Information
161143
run: uv pip list

.github/workflows/weekly.yml

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,13 @@ jobs:
1919
- name: Checkout Code
2020
uses: actions/checkout@v4
2121

22-
- name: Setup Python
23-
uses: actions/setup-python@v5
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
2722
- name: Install a specific version of uv
2823
uses: astral-sh/setup-uv@v3
2924
with:
3025
version: "latest"
3126

32-
- name: Make uv use system python
33-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
27+
- name: Create Virtual Environment
28+
run: uv venv --python ${{ matrix.python-version }}
3429

3530
- name: Install Packages
3631
run: |
@@ -63,18 +58,13 @@ jobs:
6358
- name: Checkout Code
6459
uses: actions/checkout@v4
6560

66-
- name: Setup Python
67-
uses: actions/setup-python@v5
68-
with:
69-
python-version: ${{ matrix.python-version }}
70-
7161
- name: Install a specific version of uv
7262
uses: astral-sh/setup-uv@v3
7363
with:
7464
version: "latest"
7565

76-
- name: Make uv use system python
77-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
66+
- name: Create Virtual Environment
67+
run: uv venv --python ${{ matrix.python-version }}
7868

7969
- name: Install Packages
8070
run: |
@@ -119,18 +109,13 @@ jobs:
119109
with:
120110
ref: ${{ steps.latestrelease.outputs.latestrelease }}
121111

122-
- name: Setup Python
123-
uses: actions/setup-python@v5
124-
with:
125-
python-version: ${{ matrix.python-version }}
126-
127112
- name: Install a specific version of uv
128113
uses: astral-sh/setup-uv@v3
129114
with:
130115
version: "latest"
131116

132-
- name: Make uv use system python
133-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
117+
- name: Create Virtual Environment
118+
run: uv venv --python ${{ matrix.python-version }}
134119

135120
- name: Install Packages
136121
run: |
@@ -174,18 +159,13 @@ jobs:
174159
with:
175160
ref: ${{ steps.latestrelease.outputs.latestrelease }}
176161

177-
- name: Setup Python
178-
uses: actions/setup-python@v5
179-
with:
180-
python-version: ${{ matrix.python-version }}
181-
182162
- name: Install a specific version of uv
183163
uses: astral-sh/setup-uv@v3
184164
with:
185165
version: "latest"
186166

187-
- name: Make uv use system python
188-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
167+
- name: Create Virtual Environment
168+
run: uv venv --python ${{ matrix.python-version }}
189169

190170
- name: Install Packages
191171
run: |
@@ -221,18 +201,13 @@ jobs:
221201
- name: Checkout Code
222202
uses: actions/checkout@v4
223203

224-
- name: Setup Python
225-
uses: actions/setup-python@v5
226-
with:
227-
python-version: ${{ matrix.python-version }}
228-
229204
- name: Install a specific version of uv
230205
uses: astral-sh/setup-uv@v3
231206
with:
232207
version: "latest"
233208

234-
- name: Make uv use system python
235-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
209+
- name: Create Virtual Environment
210+
run: uv venv --python ${{ matrix.python-version }}
236211

237212
- name: Install Packages
238213
run: |
@@ -260,18 +235,13 @@ jobs:
260235
- name: Checkout Code
261236
uses: actions/checkout@v4
262237

263-
- name: Setup Python
264-
uses: actions/setup-python@v5
265-
with:
266-
python-version: ${{ matrix.python-version }}
267-
268238
- name: Install a specific version of uv
269239
uses: astral-sh/setup-uv@v3
270240
with:
271241
version: "latest"
272242

273-
- name: Make uv use system python
274-
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV
243+
- name: Create Virtual Environment
244+
run: uv venv --python ${{ matrix.python-version }}
275245

276246
- name: Install Packages
277247
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ clean-cache:
5151
find . -name '__pycache__' -exec rm -fr {} +
5252

5353
clean-test:
54-
rm -f .coverage
54+
$(UVRUN) coverage erase
5555
rm -f coverage.xml
5656
rm -fr htmlcov/
5757
rm -fr tests/result_images/*

0 commit comments

Comments
 (0)