@@ -107,6 +107,7 @@ jobs:
107
107
with :
108
108
model : qwen2:0.5b
109
109
110
+ - run : uv sync --only-dev
110
111
- run : >
111
112
uv run
112
113
--package pydantic-ai-slim
@@ -130,13 +131,14 @@ jobs:
130
131
CO_API_KEY: ${{ secrets.COHERE_API_KEY }}
131
132
132
133
test :
133
- name : test on ${{ matrix.python-version }}
134
+ name : test on ${{ matrix.python-version }} (${{ matrix.install }})
134
135
runs-on : ubuntu-latest
135
136
timeout-minutes : 10
136
137
strategy :
137
138
fail-fast : false
138
139
matrix :
139
140
python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
141
+ install : ["slim", "standard", "all-extras"]
140
142
env :
141
143
UV_PYTHON : ${{ matrix.python-version }}
142
144
CI : true
@@ -148,46 +150,98 @@ jobs:
148
150
with :
149
151
enable-cache : true
150
152
151
- - uses : denoland/setup-deno@v2
152
- with :
153
- deno-version : v2.x
153
+ - run : |
154
+ if [ "${{ matrix.install }}" = "slim" ]; then
155
+ echo "--package pydantic-ai-slim"
156
+ elif [ "${{ matrix.install }}" = "standard" ]; then
157
+ echo ""
158
+ elif [ "${{ matrix.install }}" = "all-extras" ]; then
159
+ echo "--all-extras"
160
+ fi
161
+ id: install-command
154
162
155
163
- run : mkdir .coverage
156
164
157
- # run tests with just `pydantic-ai-slim` dependencies
158
- - run : uv run --package pydantic-ai-slim coverage run -m pytest -n auto --dist=loadgroup
165
+ - run : uv sync --group dev
166
+ - run : uv run ${{ steps.install-command.outputs.install-command }} coverage run -m pytest -n auto --dist=loadgroup
159
167
env :
160
- COVERAGE_FILE : .coverage/.coverage.${{ runner.os }}-py ${{ matrix.python-version }}-slim
168
+ COVERAGE_FILE : .coverage/.coverage.${{ matrix.python-version }}-${{ matrix.install }}
161
169
162
- - run : uv run coverage run -m pytest -n auto --dist=loadgroup
163
- env :
164
- COVERAGE_FILE : .coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-standard
170
+ - name : store coverage files
171
+ uses : actions/upload-artifact@v4
172
+ if : matrix.python-version != '3.9'
173
+ with :
174
+ name : coverage-${{ matrix.python-version }}-${{ matrix.install }}
175
+ path : .coverage
176
+ include-hidden-files : true
165
177
166
- - run : uv run --all-extras coverage run -m pytest -n auto --dist=loadgroup
167
- env :
168
- COVERAGE_FILE : .coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-all-extras
178
+ test-lowest-versions :
179
+ name : test on ${{ matrix.python-version }} (lowest-versions)
180
+ runs-on : ubuntu-latest
181
+ timeout-minutes : 10
182
+ strategy :
183
+ fail-fast : false
184
+ matrix :
185
+ python-version : ["3.10", "3.11", "3.12", "3.13"]
186
+ env :
187
+ UV_PYTHON : ${{ matrix.python-version }}
188
+ CI : true
189
+ COVERAGE_PROCESS_START : ./pyproject.toml
190
+ steps :
191
+ - uses : actions/checkout@v4
169
192
170
- - run : uv run --all-extras python tests/import_examples.py
193
+ - uses : astral-sh/setup-uv@v5
194
+ with :
195
+ enable-cache : true
171
196
172
- # this must run last as it modifies the environment!
173
- - name : test lowest versions
174
- if : matrix.python-version != '3.9'
175
- run : |
176
- unset UV_FROZEN
177
- uv run --all-extras --resolution lowest-direct coverage run -m pytest -n auto --dist=loadgroup
197
+ - uses : denoland/setup-deno@v2
198
+ with :
199
+ deno-version : v2.x
200
+
201
+ - run : mkdir .coverage
202
+
203
+ - run : uv sync --group dev
204
+
205
+ - run : unset UV_FROZEN
206
+
207
+ - run : uv run --all-extras --resolution lowest-direct coverage run -m pytest -n auto --dist=loadgroup
178
208
env :
179
- COVERAGE_FILE : .coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-lowest-versions
209
+ COVERAGE_FILE : .coverage/.coverage.${{matrix.python-version}}-lowest-versions
180
210
181
211
- name : store coverage files
182
212
uses : actions/upload-artifact@v4
183
213
with :
184
- name : coverage-${{ matrix.python-version }}
214
+ name : coverage-${{ matrix.python-version }}-lowest-versions
185
215
path : .coverage
186
216
include-hidden-files : true
187
217
218
+ test-examples :
219
+ name : test examples on ${{ matrix.python-version }}
220
+ runs-on : ubuntu-latest
221
+ timeout-minutes : 10
222
+ strategy :
223
+ fail-fast : false
224
+ matrix :
225
+ python-version : ["3.11", "3.12", "3.13"]
226
+ env :
227
+ UV_PYTHON : ${{ matrix.python-version }}
228
+ CI : true
229
+ steps :
230
+ - uses : actions/checkout@v4
231
+
232
+ - uses : astral-sh/setup-uv@v5
233
+ with :
234
+ enable-cache : true
235
+
236
+ - uses : denoland/setup-deno@v2
237
+ with :
238
+ deno-version : v2.x
239
+
240
+ - run : uv run --all-extras python tests/import_examples.py
241
+
188
242
coverage :
189
243
runs-on : ubuntu-latest
190
- needs : [test]
244
+ needs : [test, test-lowest-versions ]
191
245
steps :
192
246
- uses : actions/checkout@v4
193
247
with :
@@ -204,8 +258,7 @@ jobs:
204
258
with :
205
259
enable-cache : true
206
260
207
- - run : uv sync --package pydantic-ai-slim --only-dev
208
- - run : rm .coverage/.coverage.*-py3.9-* # Exclude 3.9 coverage as it gets the wrong line numbers, causing invalid failures.
261
+ - run : uv sync --group dev
209
262
- run : uv run coverage combine
210
263
- run : uv run coverage report
211
264
@@ -239,7 +292,7 @@ jobs:
239
292
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
240
293
check :
241
294
if : always()
242
- needs : [lint, mypy, docs, test-live, test, coverage, test-mcp-run-python]
295
+ needs : [lint, mypy, docs, test-live, test, test-lowest-versions, test-examples, coverage, test-mcp-run-python]
243
296
runs-on : ubuntu-latest
244
297
245
298
steps :
0 commit comments