-
Notifications
You must be signed in to change notification settings - Fork 407
ci: add a smoke test running outside of the default virtual env #899
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
+131
−0
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f7f26c9
ci: add a smoke test running outside of the default virtual env
ishymko d73f9a1
Fix
ishymko c6debea
Merge branch '1.0-dev' into ishymko/integration-package-test
ishymko e9efc5c
Updates
ishymko 5d7c9f6
Updates
ishymko 376e2e7
Updates
ishymko 7659b8a
Updates
ishymko cba5fc2
Merge branch '1.0-dev' into ishymko/integration-package-test
ishymko 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| name: Minimal Install Smoke Test | ||
| on: | ||
| push: | ||
| branches: [main, 1.0-dev] | ||
| pull_request: | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| minimal-install: | ||
| name: Verify base-only install | ||
| runs-on: ubuntu-latest | ||
| if: github.repository == 'a2aproject/a2a-python' | ||
| strategy: | ||
| matrix: | ||
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Build package | ||
| run: uv build --wheel | ||
|
|
||
| - name: Install with base dependencies only | ||
| run: | | ||
| uv venv .venv-minimal | ||
| # Install only the built wheel -- no extras, no dev deps. | ||
| # This simulates what an end-user gets with `pip install a2a-sdk`. | ||
| VIRTUAL_ENV=.venv-minimal uv pip install dist/*.whl | ||
|
|
||
| - name: List installed packages | ||
| run: VIRTUAL_ENV=.venv-minimal uv pip list | ||
|
|
||
| - name: Run import smoke test | ||
| run: .venv-minimal/bin/python scripts/test_minimal_install.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,90 @@ | ||
| #!/usr/bin/env python3 | ||
| """Smoke test for minimal (base-only) installation of a2a-sdk. | ||
|
|
||
| This script verifies that all core public API modules can be imported | ||
| when only the base dependencies are installed (no optional extras). | ||
|
|
||
| It is designed to run WITHOUT pytest or any dev dependencies -- just | ||
| a clean venv with `pip install a2a-sdk`. | ||
|
|
||
| Usage: | ||
| python scripts/test_minimal_install.py | ||
|
|
||
| Exit codes: | ||
| 0 - All core imports succeeded | ||
| 1 - One or more core imports failed | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import importlib | ||
| import sys | ||
|
|
||
|
|
||
| # Core modules that MUST be importable with only base dependencies. | ||
| # These are the public API surface that every user gets with | ||
| # `pip install a2a-sdk` (no extras). | ||
| # | ||
| # Do NOT add modules here that require optional extras (grpc, | ||
| # http-server, sql, signing, telemetry, vertex, etc.). | ||
| # Those modules are expected to fail without their extras installed | ||
| # and should use try/except ImportError guards internally. | ||
| CORE_MODULES = [ | ||
| 'a2a', | ||
| 'a2a.client', | ||
| 'a2a.client.auth', | ||
| 'a2a.client.base_client', | ||
| 'a2a.client.card_resolver', | ||
| 'a2a.client.client', | ||
| 'a2a.client.client_factory', | ||
| 'a2a.client.errors', | ||
| 'a2a.client.helpers', | ||
| 'a2a.client.interceptors', | ||
| 'a2a.client.optionals', | ||
| 'a2a.client.transports', | ||
| 'a2a.server', | ||
| 'a2a.server.agent_execution', | ||
| 'a2a.server.context', | ||
| 'a2a.server.events', | ||
| 'a2a.server.request_handlers', | ||
| 'a2a.server.tasks', | ||
| 'a2a.types', | ||
| 'a2a.utils', | ||
| 'a2a.utils.artifact', | ||
| 'a2a.utils.constants', | ||
| 'a2a.utils.error_handlers', | ||
| 'a2a.utils.helpers', | ||
| 'a2a.utils.message', | ||
| 'a2a.utils.parts', | ||
| 'a2a.utils.proto_utils', | ||
| 'a2a.utils.task', | ||
| ] | ||
|
|
||
|
|
||
| def main() -> int: | ||
| failures: list[str] = [] | ||
| successes: list[str] = [] | ||
|
|
||
| for module_name in CORE_MODULES: | ||
| try: | ||
| importlib.import_module(module_name) | ||
| successes.append(module_name) | ||
| except Exception as e: # noqa: BLE001, PERF203 | ||
| failures.append(f'{module_name}: {e}') | ||
|
|
||
| print(f'Tested {len(CORE_MODULES)} core modules') | ||
| print(f' Passed: {len(successes)}') | ||
| print(f' Failed: {len(failures)}') | ||
|
|
||
| if failures: | ||
| print('\nFAILED imports:') | ||
| for failure in failures: | ||
| print(f' - {failure}') | ||
| return 1 | ||
|
|
||
| print('\nAll core modules imported successfully.') | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| sys.exit(main()) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.