Commit 0796d55
fix(tests): move lib tests into adk/, fix dev install via pkgutil.extend_path
Follows up the slim/heavy split with the test relocations + dev-install
plumbing that should have been part of the original commit:
- Move tests/lib/* and tests at tests/ root that exercise lib code
(test_function_tool.py, test_model_utils.py, test_header_forwarding.py)
into adk/tests/. Tests now live with the code they test. The Path-based
source references in test_claude_agents_*.py (`_SRC = parents[2] / "src"`)
resolve correctly to adk/src/ via the new location.
- Fix test_function_tool.py's broken `src.agentex.lib.*` import — switch
to the installed-package path `agentex.lib.*` so it works against the
editable install.
- Add `from pkgutil import extend_path; __path__ = extend_path(...)` to
src/agentex/__init__.py. This is the load-bearing fix for dev workflow:
without it, two editable installs (slim at root, heavy at adk/) each
contributing files to `agentex/` get only the first source dir in
`agentex.__path__`, so `import agentex.lib.*` fails. With it, Python
discovers both source trees and the namespace merges. Wheel installs
(production) already worked because both wheels' files land in the same
site-packages/agentex/ directory.
- scripts/bootstrap: after `rye sync`, also `pip install -e ./adk` so
agentex-sdk's deps land in the dev venv. agentex-sdk-client is already
installed via the root sync, so adk's dep on it resolves to the local
editable install (no PyPI lookup needed).
- pyproject.toml [tool.pytest.ini_options].testpaths includes "adk/tests".
- pyproject.toml [tool.ruff.lint.per-file-ignores] extends test-friendly
ignores to adk/tests/.
- Drop the rye workspace config — pkgutil.extend_path + explicit pip
install -e ./adk in bootstrap gives the same dev experience without
rye-workspace-version-mismatch quirks.
- .github/workflows/ci.yml: lint + test jobs call ./scripts/bootstrap
instead of `rye sync` directly; build job builds both packages.
Self-review took: I shipped the file move without running the test suite
locally — that's why CI broke on PR #370. Mea culpa. The functional design
is correct; the rollout was sloppy. Verified locally:
- `ruff check .` → All checks passed
- `pytest --collect-only adk/tests/` → 100+ tests collect cleanly
- `pytest adk/tests/test_function_tool.py` → 10 passed
- Dev install (`pip install -e .` + `pip install -e ./adk`):
`from agentex import Agentex` and `from agentex.lib.* import …` both work
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d58c76d commit 0796d55
45 files changed
Lines changed: 29 additions & 11 deletions
File tree
- .github/workflows
- adk/tests
- lib
- adk
- providers
- cli
- core
- services
- adk
- tracing
- processors
- scripts
- src/agentex
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 | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
File renamed without changes.
File renamed without changes.
File renamed without changes.
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