Skip to content

Commit 0796d55

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
RYE_INSTALL_OPTION: '--yes'
3333

3434
- name: Install dependencies
35-
run: rye sync --all-features
35+
run: ./scripts/bootstrap
3636

3737
- name: Run lints
3838
run: ./scripts/lint
@@ -57,11 +57,14 @@ jobs:
5757
RYE_INSTALL_OPTION: '--yes'
5858

5959
- name: Install dependencies
60-
run: rye sync --all-features
60+
run: ./scripts/bootstrap
6161

62-
- name: Run build
62+
- name: Run build (slim agentex-sdk-client)
6363
run: rye build
6464

65+
- name: Run build (ADK overlay agentex-sdk)
66+
run: (cd adk && rye build)
67+
6568
- name: Get GitHub OIDC Token
6669
if: |-
6770
github.repository == 'stainless-sdks/agentex-sdk-python' &&
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)