Commit 0645fb0
fix(ci): pyright/mypy extraPaths for adk/src, pytest --import-mode=importlib
Two CI breakages I didn't catch locally:
1. **pyright didn't know about adk/src/** so all `from agentex.lib.*`
imports failed `reportMissingImports`. Pyright doesn't auto-discover
editable installs the way Python's runtime does. Fix:
- Add `extraPaths = ["src", "adk/src"]` at root of [tool.pyright] and
per execution-environment. This tells pyright to resolve imports
against both source trees.
- Update the strict-typecheck execution environment root from the
deleted `src/agentex/lib` to `adk/src/agentex/lib`.
- Add a new tests/-equivalent execution environment for `adk/tests`.
- Same fix for mypy: add `mypy_path = "src:adk/src"`, exclude
`adk/tests/.*` to match the tests/.* exclusion.
2. **pytest collected tests/ and adk/tests/ as both being top-level
package `tests`** (both have __init__.py), so it hit "duplicate
package name" errors:
ERROR collecting adk/tests/lib/adk - ModuleNotFoundError: No module named 'tests.lib'
Fix: `--import-mode=importlib` in addopts. This is the modern
recommended pytest mode and tolerates same-name test packages.
Verified locally with `pytest --collect-only tests adk/tests
--import-mode=importlib`: 2204 tests collected cleanly, no errors.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ee1d1fe commit 0645fb0
1 file changed
Lines changed: 23 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
| |||
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
177 | 186 | | |
178 | 187 | | |
179 | 188 | | |
| |||
201 | 210 | | |
202 | 211 | | |
203 | 212 | | |
204 | | - | |
| 213 | + | |
205 | 214 | | |
| 215 | + | |
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
| 222 | + | |
212 | 223 | | |
213 | 224 | | |
214 | 225 | | |
215 | 226 | | |
216 | 227 | | |
217 | 228 | | |
| 229 | + | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
221 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
222 | 241 | | |
223 | 242 | | |
224 | 243 | | |
| |||
229 | 248 | | |
230 | 249 | | |
231 | 250 | | |
232 | | - | |
| 251 | + | |
| 252 | + | |
233 | 253 | | |
234 | 254 | | |
235 | 255 | | |
| |||
0 commit comments