Commit 05eeaee
ci: install only the extras the tests use, and drop the stale asyncio_mode option
The unit-test workflow installed --all-extras, which after the packaging fixes
on this branch meant 316 packages: gcp, aws, azure, kfp, sagemaker, mlflow,
wandb and the genai stack on top of torch, tensorflow and a set of CUDA wheels.
An AST audit of every import in tests/ finds exactly four optional modules -
torch, tensorflow, keras and sklearn - and nothing else. tensorflow and
scikit-learn already come from the dev group and keras ships inside tensorflow,
so `pytorch` is the only extra the suite needs. The genai tests pass without
langchain, langgraph or openai installed (they mock the clients), and no test
imports mlflow, wandb, azure, kfp, sagemaker or google.cloud at all.
The three test jobs now install 188 packages instead of 316 - and instead of
the 289 they installed before this branch, so CI is lighter than it was rather
than heavier. No coverage is lost: the extras' own correctness is asserted by
tests/test_packaging_metadata.py, and the release workflow still performs a
full --all-extras install, which is where a broken extra actually matters.
Also removes `asyncio_mode = "auto"` from the pytest config. pytest-asyncio is
not a dependency, so the option was silently unknown and emitted a
PytestConfigWarning on every run. It was also a trap: a future bare
`async def test_` would have been collected and never awaited. The suite's four
async tests are driven by anyio's pytest plugin through `@pytest.mark.anyio`,
which works because anyio ships with starlette - verified by breaking an
assertion inside one and confirming it fails rather than passing vacuously.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1CErYvpggWAogJ9MDVqj41 parent 0756129 commit 05eeaee
2 files changed
Lines changed: 34 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
112 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
113 | 131 | | |
114 | 132 | | |
115 | 133 | | |
| |||
182 | 200 | | |
183 | 201 | | |
184 | 202 | | |
185 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
186 | 213 | | |
187 | 214 | | |
188 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| |||
0 commit comments