-
Notifications
You must be signed in to change notification settings - Fork 8
fix(packaging): guard agentex-client surface, bump floor, smoke-test wheel install #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
| # Smoke: agentex-client + agentex-sdk must install together into one working | ||
| # agentex.* namespace. Builds + installs in a clean temp dir to avoid stale dist/. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| cd "$(dirname "$0")/.." | ||
|
|
||
| work="$(mktemp -d)" | ||
| echo "==> building both wheels into $work/dist" | ||
| uv build --all-packages --wheel --out-dir "$work/dist" | ||
|
|
||
| venv="$work/venv" | ||
| uv venv "$venv" >/dev/null | ||
| echo "==> installing both wheels into a fresh venv" | ||
| uv pip install --python "$venv" "$work"/dist/agentex_client-*.whl "$work"/dist/agentex_sdk-*.whl | ||
|
|
||
| echo "==> importing the merged namespace from the installed wheels" | ||
| "$venv/bin/python" - <<'PY' | ||
| import agentex.lib.adk # ADK overlay — ships in agentex-sdk | ||
| from agentex.types import Event # client surface — ships in agentex-client | ||
| from agentex.resources import states # client surface that "didn't land" in the incident | ||
|
|
||
| print("agentex namespace OK:", Event.__name__, states.__name__) | ||
| PY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from agentex.lib._version_guard import verify_client_compatibility | ||
|
|
||
| # Fail fast + clearly on a skewed/incomplete agentex-client install. | ||
| verify_client_compatibility() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| """Fail fast with a clear error on an incomplete agentex-client install instead | ||
| of a cryptic `cannot import name ... from agentex.types`.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from importlib.metadata import PackageNotFoundError, version | ||
|
|
||
|
|
||
| def _installed(package: str) -> str: | ||
| try: | ||
| return version(package) | ||
| except PackageNotFoundError: | ||
| return "unknown" | ||
|
|
||
|
|
||
| def verify_client_compatibility() -> None: | ||
| # Canary on the client REST surface, not the version: newer clients are fine | ||
| # (additive); we only fail if a symbol/resource the ADK needs is absent. | ||
| try: | ||
| from agentex.types import Event as _Event # noqa: F401 | ||
| from agentex.resources import states as _states # noqa: F401 | ||
| except (ImportError, AttributeError) as exc: | ||
| raise ImportError( | ||
| f"agentex-sdk could not import the agentex-client REST surface it " | ||
| f"depends on (agentex-sdk={_installed('agentex-sdk')}, " | ||
| f"agentex-client={_installed('agentex-client')}). Reinstall both at a " | ||
| f"compatible version, e.g. `pip install --force-reinstall agentex-sdk`." | ||
| ) from exc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| """Tests for the agentex-client compatibility guard (0.13.0 split regression).""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import pytest | ||
|
|
||
| import agentex.lib._version_guard as guard | ||
|
|
||
|
|
||
| def test_passes_when_surface_present() -> None: | ||
| guard.verify_client_compatibility() # full client surface installed | ||
|
|
||
|
|
||
| def test_newer_client_not_rejected(monkeypatch: pytest.MonkeyPatch) -> None: | ||
| # Version is not a gate: a newer client (additive) with the full surface passes. | ||
| monkeypatch.setattr(guard, "version", lambda pkg: "0.14.0" if pkg == "agentex-client" else "0.13.0") | ||
| guard.verify_client_compatibility() | ||
|
|
||
|
|
||
| def test_raises_when_client_surface_incomplete(monkeypatch: pytest.MonkeyPatch) -> None: | ||
| import agentex.types | ||
|
|
||
| # A partial install missing a needed symbol fails with an actionable error. | ||
| monkeypatch.delattr(agentex.types, "Event", raising=False) | ||
| with pytest.raises(ImportError, match="could not import the agentex-client REST surface"): | ||
| guard.verify_client_compatibility() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR raises the ADK dependency to
agentex-client>=0.13.0, butuv.lockstill records the workspace packages as0.12.0and the ADK lock metadata still has only the editableagentex-clientdependency without this floor. A frozen or locked install can keep resolving the stale 0.12.0 metadata, so tests and local installs may not exercise the package contract this change is meant to enforce. Please regenerateuv.lockso it records the 0.13.0 package versions and updated ADK dependency floor.Artifacts
Repro: TOML metadata inspection script
Repro: lock inspection output showing stale package versions and missing dependency floor
Repro: uv lock check attempt showing uv unavailable
Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lockfile is now updated.