Skip to content

Commit 643070f

Browse files
author
daniel.eades
committed
chore(ci): use uv native interface to simplify CI
1 parent 91230c8 commit 643070f

File tree

5 files changed

+21
-197
lines changed

5 files changed

+21
-197
lines changed

.github/workflows/builddoc.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ concurrency:
1414

1515
env:
1616
FORCE_COLOR: "1"
17-
UV_SYSTEM_PYTHON: "1" # make uv do global installs
1817

1918
jobs:
2019
verbose:
@@ -35,13 +34,5 @@ jobs:
3534
with:
3635
version: latest
3736
enable-cache: false
38-
- name: Install dependencies
39-
run: uv pip install . --group docs
4037
- name: Render the documentation
41-
run: >
42-
sphinx-build
43-
-M html ./doc ./build/sphinx
44-
--verbose
45-
--jobs=auto
46-
--show-traceback
47-
--fail-on-warning
38+
run: uv run --group docs sphinx-build -M html ./doc ./build/sphinx --verbose --jobs=auto --show-traceback --fail-on-warning

.github/workflows/create-release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ concurrency:
1515

1616
env:
1717
FORCE_COLOR: "1"
18-
UV_SYSTEM_PYTHON: "1" # make uv do global installs
1918

2019
jobs:
2120
publish-pypi:
@@ -40,14 +39,11 @@ jobs:
4039
version: latest
4140
enable-cache: false
4241

43-
- name: Install build dependencies (pypa/build, twine)
44-
run: uv pip install --group package
45-
4642
- name: Build distribution
47-
run: python -m build
43+
run: uv run --group package python -m build .
4844

4945
- name: Check distribution
50-
run: twine check dist/*
46+
run: uv run --group package twine check dist/*
5147

5248
- name: Create Sigstore attestations for built distributions
5349
uses: actions/attest@v1

.github/workflows/lint.yml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ concurrency:
1414

1515
env:
1616
FORCE_COLOR: "1"
17-
UV_SYSTEM_PYTHON: "1" # make uv do global installs
1817

1918
jobs:
2019
# If you update any of these commands, don't forget to update the equivalent
@@ -54,10 +53,8 @@ jobs:
5453
with:
5554
version: latest
5655
enable-cache: false
57-
- name: Install dependencies
58-
run: uv pip install -r pyproject.toml --group package --group test --group types
5956
- name: Type check with mypy
60-
run: mypy
57+
run: uv run --group package --group test --group types mypy
6158

6259
pyright:
6360
runs-on: ubuntu-latest
@@ -75,10 +72,8 @@ jobs:
7572
with:
7673
version: latest
7774
enable-cache: false
78-
- name: Install dependencies
79-
run: uv pip install -r pyproject.toml --group package --group test --group types
8075
- name: Type check with pyright
81-
run: pyright
76+
run: uv run --group package --group test --group types pyright
8277

8378
ty:
8479
runs-on: ubuntu-latest
@@ -96,10 +91,8 @@ jobs:
9691
with:
9792
version: latest
9893
enable-cache: false
99-
- name: Install dependencies
100-
run: uv pip install -r pyproject.toml --group package --group test --group types
10194
- name: Type check with ty
102-
run: ty check --color=always
95+
run: uv run --group package --group test --group types ty check --color=always
10396

10497
docs-lint:
10598
runs-on: ubuntu-latest
@@ -117,10 +110,8 @@ jobs:
117110
with:
118111
version: latest
119112
enable-cache: false
120-
- name: Install dependencies
121-
run: uv pip install --group lint
122113
- name: Lint documentation with sphinx-lint
123-
run: make doclinter
114+
run: uv run --group lint make doclinter
124115

125116
twine:
126117
runs-on: ubuntu-latest
@@ -138,12 +129,8 @@ jobs:
138129
with:
139130
version: latest
140131
enable-cache: false
141-
- name: Install dependencies
142-
run: uv pip install --group package
143132
- name: Lint with twine
144-
run: |
145-
python -m build .
146-
twine check dist/*
133+
run: uv run --group package python -m build . && twine check dist/*
147134

148135
prettier:
149136
runs-on: ubuntu-latest

.github/workflows/main.yml

Lines changed: 8 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ env:
2525
FORCE_COLOR: "1"
2626
PYTHONDEVMODE: "1" # -X dev
2727
PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding
28-
UV_SYSTEM_PYTHON: "1" # make uv do global installs
2928

3029
jobs:
3130
ubuntu:
@@ -42,6 +41,7 @@ jobs:
4241
- "3.13t"
4342
- "3.14"
4443
- "3.14t"
44+
- "3.15"
4545
docutils:
4646
- "0.20"
4747
- "0.22"
@@ -58,97 +58,14 @@ jobs:
5858
run: |
5959
mkdir -p ./tests/roots-read-only
6060
sudo mount -v --bind --read-only ./tests/roots ./tests/roots-read-only
61-
- name: Set up Python ${{ matrix.python }}
62-
uses: actions/setup-python@v6
63-
with:
64-
python-version: ${{ matrix.python }}
65-
- name: Check Python version
66-
run: python --version --version
6761
- name: Install graphviz
6862
run: sudo apt-get install --no-install-recommends --yes graphviz
6963
- name: Install uv
7064
uses: astral-sh/setup-uv@v7
7165
with:
7266
version: latest
73-
enable-cache: false
74-
- name: Install dependencies
75-
run: uv pip install . --group test
76-
env:
77-
UV_PYTHON: "python${{ matrix.python }}"
78-
- name: Install Docutils ${{ matrix.docutils }}
79-
run: uv pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
80-
env:
81-
UV_PYTHON: "python${{ matrix.python }}"
82-
- name: Test with pytest
83-
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
84-
env:
85-
PYTHONWARNINGS: "error" # treat all warnings as errors
86-
87-
deadsnakes:
88-
runs-on: ubuntu-latest
89-
name: Python ${{ matrix.python }} (Docutils ${{ matrix.docutils }})
90-
timeout-minutes: 15
91-
strategy:
92-
fail-fast: false
93-
matrix:
94-
python:
95-
- "3.15"
96-
docutils:
97-
- "0.20"
98-
- "0.22"
99-
100-
steps:
101-
- uses: actions/checkout@v6
102-
with:
103-
persist-credentials: false
104-
- name: Set up Python ${{ matrix.python }} (deadsnakes)
105-
uses: deadsnakes/action@v3.2.0
106-
with:
107-
python-version: ${{ matrix.python }}-dev
108-
- name: Check Python version
109-
run: python --version --version
110-
- name: Install graphviz
111-
run: sudo apt-get install --no-install-recommends --yes graphviz
112-
- name: Install dependencies
113-
run: |
114-
python -m pip install --upgrade pip
115-
python -m pip install . --group test
116-
- name: Install Docutils ${{ matrix.docutils }}
117-
run: python -m pip install --upgrade "docutils~=${{ matrix.docutils }}.0"
11867
- name: Test with pytest
119-
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
120-
env:
121-
PYTHONWARNINGS: "error" # treat all warnings as errors
122-
123-
deadsnakes-free-threaded:
124-
runs-on: ubuntu-latest
125-
name: Python ${{ matrix.python }} (free-threaded)
126-
timeout-minutes: 15
127-
strategy:
128-
fail-fast: false
129-
matrix:
130-
python:
131-
- "3.15"
132-
133-
steps:
134-
- uses: actions/checkout@v6
135-
with:
136-
persist-credentials: false
137-
- name: Set up Python ${{ matrix.python }} (deadsnakes)
138-
uses: deadsnakes/action@v3.2.0
139-
with:
140-
python-version: ${{ matrix.python }}-dev
141-
nogil: true
142-
- name: Check Python version
143-
run: python --version --version
144-
- name: Install graphviz
145-
run: sudo apt-get install --no-install-recommends --yes graphviz
146-
- name: Install dependencies
147-
run: |
148-
python -m pip install --upgrade pip
149-
python -m pip install . --group test
150-
- name: Test with pytest
151-
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
68+
run: uv run --python ${{ matrix.python }} --with "docutils~=${{ matrix.docutils }}.0" --group test pytest -n logical --dist=worksteal -vv --durations 25
15269
env:
15370
PYTHONWARNINGS: "error" # treat all warnings as errors
15471

@@ -169,23 +86,14 @@ jobs:
16986
- uses: actions/checkout@v6
17087
with:
17188
persist-credentials: false
172-
- name: Set up Python
173-
uses: actions/setup-python@v6
174-
with:
175-
python-version: "3"
176-
- name: Check Python version
177-
run: python --version --version
17889
- name: Install graphviz
17990
run: choco install --no-progress graphviz
18091
- name: Install uv
18192
uses: astral-sh/setup-uv@v7
18293
with:
18394
version: latest
184-
enable-cache: false
185-
- name: Install dependencies
186-
run: uv pip install . --group test
18795
- name: Test with pytest
188-
run: python -m pytest -vv --durations 25
96+
run: uv run --group test pytest -vv --durations 25
18997
env:
19098
PYTHONWARNINGS: "error" # treat all warnings as errors
19199

@@ -198,23 +106,14 @@ jobs:
198106
- uses: actions/checkout@v6
199107
with:
200108
persist-credentials: false
201-
- name: Set up Python
202-
uses: actions/setup-python@v6
203-
with:
204-
python-version: "3"
205-
- name: Check Python version
206-
run: python --version --version
207109
- name: Install graphviz
208110
run: brew install graphviz
209111
- name: Install uv
210112
uses: astral-sh/setup-uv@v7
211113
with:
212114
version: latest
213-
enable-cache: false
214-
- name: Install dependencies
215-
run: uv pip install . --group test
216115
- name: Test with pytest
217-
run: python -m pytest -vv --durations 25
116+
run: uv run --group test pytest -vv --durations 25
218117
env:
219118
PYTHONWARNINGS: "error" # treat all warnings as errors
220119

@@ -233,25 +132,14 @@ jobs:
233132
- uses: actions/checkout@v6
234133
with:
235134
persist-credentials: false
236-
- name: Set up Python
237-
uses: actions/setup-python@v6
238-
with:
239-
python-version: "3"
240-
- name: Check Python version
241-
run: python --version --version
242135
- name: Install graphviz
243136
run: sudo apt-get install --no-install-recommends --yes graphviz
244137
- name: Install uv
245138
uses: astral-sh/setup-uv@v7
246139
with:
247140
version: latest
248-
enable-cache: false
249-
- name: Install dependencies
250-
run: uv pip install . --group test
251-
- name: Install Docutils' HEAD
252-
run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils"
253141
- name: Test with pytest
254-
run: python -m pytest -n logical --dist=worksteal -vv
142+
run: uv run --with "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils" --group test pytest -n logical --dist=worksteal -vv
255143
env:
256144
PYTHONWARNINGS: "error" # treat all warnings as errors
257145
DO_EPUBCHECK: "1"
@@ -266,25 +154,14 @@ jobs:
266154
- uses: actions/checkout@v6
267155
with:
268156
persist-credentials: false
269-
- name: Set up Python
270-
uses: actions/setup-python@v6
271-
with:
272-
python-version: "3"
273-
- name: Check Python version
274-
run: python --version --version
275157
- name: Install graphviz
276158
run: sudo apt-get install --no-install-recommends --yes graphviz
277159
- name: Install uv
278160
uses: astral-sh/setup-uv@v7
279161
with:
280162
version: latest
281-
enable-cache: false
282-
- name: Install dependencies
283-
run: |
284-
uv pip install . --group test --resolution lowest-direct
285-
uv pip install alabaster==1.0.0
286163
- name: Test with pytest
287-
run: python -m pytest -n logical --dist=worksteal -vv --durations 25
164+
run: uv run --with alabaster==1.0.0 --group test pytest -n logical --dist=worksteal -vv --durations 25
288165
env:
289166
PYTHONWARNINGS: "error" # treat all warnings as errors
290167

@@ -299,23 +176,12 @@ jobs:
299176
- uses: actions/checkout@v6
300177
with:
301178
persist-credentials: false
302-
- name: Set up Python
303-
uses: actions/setup-python@v6
304-
with:
305-
python-version: "3"
306-
- name: Check Python version
307-
run: python --version --version
308179
- name: Install uv
309180
uses: astral-sh/setup-uv@v7
310181
with:
311182
version: latest
312-
enable-cache: false
313-
- name: Install dependencies
314-
run: uv pip install . --group test
315-
- name: Install Docutils' HEAD
316-
run: uv pip install "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils"
317183
- name: Test with pytest
318-
run: python -m pytest -vv --durations 25
184+
run: uv run --with "docutils @ git+https://repo.or.cz/docutils.git#subdirectory=docutils" --group test pytest -vv --durations 25
319185
env:
320186
PYTHONWARNINGS: "error" # treat all warnings as errors
321187
DO_EPUBCHECK: "1"
@@ -330,24 +196,13 @@ jobs:
330196
- uses: actions/checkout@v6
331197
with:
332198
persist-credentials: false
333-
- name: Set up Python
334-
uses: actions/setup-python@v6
335-
with:
336-
python-version: "3"
337-
- name: Check Python version
338-
run: python --version --version
339199
- name: Install graphviz
340200
run: sudo apt-get install --no-install-recommends --yes graphviz
341201
- name: Install uv
342202
uses: astral-sh/setup-uv@v7
343203
with:
344204
version: latest
345-
enable-cache: false
346-
- name: Install dependencies
347-
run: uv pip install . --group test pytest-cov
348205
- name: Test with pytest
349-
run: python -m pytest -vv --cov . --cov-append --cov-config pyproject.toml
350-
env:
351-
VIRTUALENV_SYSTEM_SITE_PACKAGES: "1"
206+
run: uv run --with pytest-cov --group test pytest -vv --cov . --cov-append --cov-config pyproject.toml
352207
- name: codecov
353208
uses: codecov/codecov-action@v5

0 commit comments

Comments
 (0)