From f7f26c9932fa282099b5bfc166652fc04576ac1f Mon Sep 17 00:00:00 2001 From: Ivan Shymko Date: Wed, 25 Mar 2026 13:16:33 +0000 Subject: [PATCH 1/6] ci: add a smoke test running outside of the default virtual env --- .github/workflows/minimal-install.yml | 38 +++++++++++ scripts/test_minimal_install.py | 90 +++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 .github/workflows/minimal-install.yml create mode 100755 scripts/test_minimal_install.py diff --git a/.github/workflows/minimal-install.yml b/.github/workflows/minimal-install.yml new file mode 100644 index 000000000..00782ae79 --- /dev/null +++ b/.github/workflows/minimal-install.yml @@ -0,0 +1,38 @@ +--- +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`. + .venv-minimal/bin/pip install dist/*.whl + + - name: Run import smoke test + run: .venv-minimal/bin/python scripts/test_minimal_install.py diff --git a/scripts/test_minimal_install.py b/scripts/test_minimal_install.py new file mode 100755 index 000000000..f4de2ee66 --- /dev/null +++ b/scripts/test_minimal_install.py @@ -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.types', + 'a2a.utils', + 'a2a.utils.constants', + 'a2a.utils.helpers', + 'a2a.utils.proto_utils', + 'a2a.utils.artifact', + 'a2a.utils.message', + 'a2a.utils.parts', + 'a2a.utils.task', + 'a2a.utils.error_handlers', + 'a2a.client', + 'a2a.client.client_factory', + 'a2a.client.base_client', + 'a2a.client.card_resolver', + 'a2a.client.client', + 'a2a.client.errors', + 'a2a.client.helpers', + 'a2a.client.interceptors', + 'a2a.client.optionals', + 'a2a.client.auth', + 'a2a.client.transports', + 'a2a.server', + 'a2a.server.context', + 'a2a.server.events', + 'a2a.server.agent_execution', + 'a2a.server.request_handlers', + 'a2a.server.tasks', +] + + +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()) From d73f9a1fabcd731f6025841cf59320f6f1049923 Mon Sep 17 00:00:00 2001 From: Ivan Shymko Date: Wed, 25 Mar 2026 13:21:37 +0000 Subject: [PATCH 2/6] Fix --- .github/workflows/minimal-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minimal-install.yml b/.github/workflows/minimal-install.yml index 00782ae79..449945dfd 100644 --- a/.github/workflows/minimal-install.yml +++ b/.github/workflows/minimal-install.yml @@ -32,7 +32,7 @@ jobs: 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`. - .venv-minimal/bin/pip install dist/*.whl + VIRTUAL_ENV=.venv-minimal uv pip install dist/*.whl - name: Run import smoke test run: .venv-minimal/bin/python scripts/test_minimal_install.py From e9efc5c1ca3f639d56e017f3ffc16e73e5455db2 Mon Sep 17 00:00:00 2001 From: Ivan Shymko Date: Wed, 25 Mar 2026 13:26:31 +0000 Subject: [PATCH 3/6] Updates --- scripts/test_minimal_install.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/scripts/test_minimal_install.py b/scripts/test_minimal_install.py index f4de2ee66..67659b726 100755 --- a/scripts/test_minimal_install.py +++ b/scripts/test_minimal_install.py @@ -31,33 +31,32 @@ # and should use try/except ImportError guards internally. CORE_MODULES = [ 'a2a', - 'a2a.types', - 'a2a.utils', - 'a2a.utils.constants', - 'a2a.utils.helpers', - 'a2a.utils.proto_utils', - 'a2a.utils.artifact', - 'a2a.utils.message', - 'a2a.utils.parts', - 'a2a.utils.task', - 'a2a.utils.error_handlers', 'a2a.client', - 'a2a.client.client_factory', + '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.auth', 'a2a.client.transports', 'a2a.server', + 'a2a.server.agent_execution', 'a2a.server.context', 'a2a.server.events', - 'a2a.server.agent_execution', - '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', ] From 5d7c9f6f51b78dcaa236fada1f067ce5bcd72e87 Mon Sep 17 00:00:00 2001 From: Ivan Shymko Date: Wed, 25 Mar 2026 13:28:31 +0000 Subject: [PATCH 4/6] Updates --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 24fda82cb..99b92360f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,6 @@ dependencies = [ "json-rpc>=1.15.0", "googleapis-common-protos>=1.70.0", "culsans>=0.11.0 ; python_full_version < '3.13'", - "packaging>=24.0", ] classifiers = [ From 376e2e74d01f15b4c5f1b7c8a91dfbf4cc9df362 Mon Sep 17 00:00:00 2001 From: Ivan Shymko Date: Wed, 25 Mar 2026 14:02:10 +0000 Subject: [PATCH 5/6] Updates --- .github/workflows/minimal-install.yml | 3 +++ pyproject.toml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/minimal-install.yml b/.github/workflows/minimal-install.yml index 449945dfd..7e0f143c6 100644 --- a/.github/workflows/minimal-install.yml +++ b/.github/workflows/minimal-install.yml @@ -34,5 +34,8 @@ jobs: # 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 diff --git a/pyproject.toml b/pyproject.toml index 99b92360f..24fda82cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ dependencies = [ "json-rpc>=1.15.0", "googleapis-common-protos>=1.70.0", "culsans>=0.11.0 ; python_full_version < '3.13'", + "packaging>=24.0", ] classifiers = [ From 7659b8a31dc89485a7c0ac8c2f2fa05ebf080dc4 Mon Sep 17 00:00:00 2001 From: Ivan Shymko Date: Wed, 25 Mar 2026 14:06:26 +0000 Subject: [PATCH 6/6] Updates --- scripts/test_minimal_install.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test_minimal_install.py b/scripts/test_minimal_install.py index 67659b726..076df4c0f 100755 --- a/scripts/test_minimal_install.py +++ b/scripts/test_minimal_install.py @@ -46,6 +46,7 @@ 'a2a.server.agent_execution', 'a2a.server.context', 'a2a.server.events', + 'a2a.server.request_handlers', 'a2a.server.tasks', 'a2a.types', 'a2a.utils',