Commit 85c2bb7
revert: keep lib/ at src/agentex/lib (Option X); pyright can't see split namespace
Pyright fails reportMissingImports on intra-lib `agentex.lib.*` imports when
lib/ lives in a sibling source tree (adk/src/agentex/lib/) because pyright
analyzes statically and doesn't run pkgutil.extend_path. Even pointing
pyright at the editable-install venv doesn't help — the static module
resolver picks `src/agentex/` (which has __init__.py) and stops; it never
discovers adk/src/agentex/lib/.
This kills the file-move (Option Y) direction. Disabling reportMissingImports
for lib loses meaningful static analysis; PEP-420 namespace (drop __init__.py)
breaks `from agentex import Agentex`.
Switching to Option X: lib/ stays at src/agentex/lib/ as it originally was.
The two packages share the source tree:
- Root pyproject's wheel target adds `exclude = ["src/agentex/lib/**"]` so
the slim wheel doesn't ship lib code.
- adk/pyproject.toml uses hatchling `force-include "../src/agentex/lib" =
"agentex/lib"` to pull lib/* into the heavy wheel from the parent dir.
- src/agentex/__init__.py reverts to its Stainless-natural form; no
pkgutil.extend_path needed (single source tree, no namespace merge).
Files reverted:
- 350 lib files: adk/src/agentex/lib → src/agentex/lib
- Test files moved earlier: adk/tests → tests (lib tests back at tests/lib)
- Pytest config: testpaths back to ["tests"]; dropped --import-mode=importlib
- Pyright config: removed extraPaths/include; restored exec-env root to
src/agentex/lib; dropped adk/tests exec env
- Mypy config: dropped mypy_path; removed adk/tests from exclude
- Ruff per-file-ignores: removed adk/tests pattern
- src/agentex/__init__.py: removed pkgutil.extend_path
Kept:
- Two-package structure (slim agentex-sdk-client at root, heavy agentex-sdk
at adk/) — the install-time win
- rye workspace so `rye sync` installs both packages' deps in the dev venv
- bin/publish-pypi dual-build, release-please two-package mode, CI dual-build
Verified locally:
- pyright on src/agentex/lib/adk/__init__.py → 0 errors
- pytest --collect-only → 2204 tests collect cleanly
- Build slim → wheel excludes agentex/lib/ correctly
- Build heavy → wheel contains only agentex/lib/* (347 files)
- Dual install: from agentex import Agentex AND from agentex.lib.* both work
- Single editable install (pip install -e . + pip install -e ./adk):
heavy deps installed (ddtrace, temporalio, fastapi, etc.); imports work
Trade-off documented in PR body: root pyproject's wheel `exclude` is a
hand-edit to Stainless's emitted file that must survive 3-way merge. Manual
edits to `dependencies = [...]` have survived historically; we're betting
the same holds for `[tool.hatch.build.targets.wheel].exclude`. If Stainless
clobbers it during a regen, options are (a) re-add manually, (b) move the
exclude to `keep_files`-protected file via dashboard config, or (c) pivot
back to file-move with pyright workarounds.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0645fb0 commit 85c2bb7
391 files changed
Lines changed: 22 additions & 60 deletions
File tree
- adk
- tests/lib/core/tracing/processors
- src/agentex
- lib
- adk
- _modules
- providers
- _modules
- utils
- _modules
- cli
- commands
- debug
- handlers
- templates
- default-langgraph
- project
- default-pydantic-ai
- project
- default
- project
- sync-langgraph
- project
- sync-openai-agents
- project
- sync-pydantic-ai
- project
- sync
- project
- temporal-openai-agents
- project
- temporal-pydantic-ai
- project
- temporal
- project
- utils
- core
- adapters
- llm
- streams
- clients
- temporal
- observability
- tests
- services
- adk
- acp
- providers
- utils
- temporal
- activities
- adk
- acp
- providers
- utils
- plugins
- claude_agents
- hooks
- openai_agents
- hooks
- interceptors
- models
- tests
- services
- types
- workers
- workflows
- tracing
- processors
- sdk
- config
- fastacp
- base
- impl
- tests
- state_machine
- utils
- types
- utils
- dev_tools
- tests
- lib
- adk
- providers
- cli
- core
- services
- adk
- tracing
- processors
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
98 | 94 | | |
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
102 | 98 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 99 | + | |
110 | 100 | | |
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 60 | + | |
| 61 | + | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
| |||
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 164 | + | |
| 165 | + | |
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
| |||
177 | 176 | | |
178 | 177 | | |
179 | 178 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 179 | | |
187 | 180 | | |
188 | 181 | | |
| |||
210 | 203 | | |
211 | 204 | | |
212 | 205 | | |
213 | | - | |
| 206 | + | |
214 | 207 | | |
215 | | - | |
216 | 208 | | |
217 | 209 | | |
218 | 210 | | |
219 | 211 | | |
220 | 212 | | |
221 | 213 | | |
222 | | - | |
223 | 214 | | |
224 | 215 | | |
225 | 216 | | |
226 | 217 | | |
227 | 218 | | |
228 | 219 | | |
229 | | - | |
230 | 220 | | |
231 | 221 | | |
232 | 222 | | |
233 | 223 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | 224 | | |
242 | 225 | | |
243 | 226 | | |
| |||
248 | 231 | | |
249 | 232 | | |
250 | 233 | | |
251 | | - | |
252 | | - | |
| 234 | + | |
253 | 235 | | |
254 | 236 | | |
255 | 237 | | |
| |||
351 | 333 | | |
352 | 334 | | |
353 | 335 | | |
354 | | - | |
355 | 336 | | |
356 | 337 | | |
357 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 3 | | |
13 | 4 | | |
14 | 5 | | |
| |||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0 commit comments