Skip to content

Commit f7f26c9

Browse files
committed
ci: add a smoke test running outside of the default virtual env
1 parent 4be2064 commit f7f26c9

2 files changed

Lines changed: 128 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Minimal Install Smoke Test
3+
on:
4+
push:
5+
branches: [main, 1.0-dev]
6+
pull_request:
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
minimal-install:
12+
name: Verify base-only install
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'a2aproject/a2a-python'
15+
strategy:
16+
matrix:
17+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v6
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v7
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Build package
28+
run: uv build --wheel
29+
30+
- name: Install with base dependencies only
31+
run: |
32+
uv venv .venv-minimal
33+
# Install only the built wheel -- no extras, no dev deps.
34+
# This simulates what an end-user gets with `pip install a2a-sdk`.
35+
.venv-minimal/bin/pip install dist/*.whl
36+
37+
- name: Run import smoke test
38+
run: .venv-minimal/bin/python scripts/test_minimal_install.py

scripts/test_minimal_install.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env python3
2+
"""Smoke test for minimal (base-only) installation of a2a-sdk.
3+
4+
This script verifies that all core public API modules can be imported
5+
when only the base dependencies are installed (no optional extras).
6+
7+
It is designed to run WITHOUT pytest or any dev dependencies -- just
8+
a clean venv with `pip install a2a-sdk`.
9+
10+
Usage:
11+
python scripts/test_minimal_install.py
12+
13+
Exit codes:
14+
0 - All core imports succeeded
15+
1 - One or more core imports failed
16+
"""
17+
18+
from __future__ import annotations
19+
20+
import importlib
21+
import sys
22+
23+
24+
# Core modules that MUST be importable with only base dependencies.
25+
# These are the public API surface that every user gets with
26+
# `pip install a2a-sdk` (no extras).
27+
#
28+
# Do NOT add modules here that require optional extras (grpc,
29+
# http-server, sql, signing, telemetry, vertex, etc.).
30+
# Those modules are expected to fail without their extras installed
31+
# and should use try/except ImportError guards internally.
32+
CORE_MODULES = [
33+
'a2a',
34+
'a2a.types',
35+
'a2a.utils',
36+
'a2a.utils.constants',
37+
'a2a.utils.helpers',
38+
'a2a.utils.proto_utils',
39+
'a2a.utils.artifact',
40+
'a2a.utils.message',
41+
'a2a.utils.parts',
42+
'a2a.utils.task',
43+
'a2a.utils.error_handlers',
44+
'a2a.client',
45+
'a2a.client.client_factory',
46+
'a2a.client.base_client',
47+
'a2a.client.card_resolver',
48+
'a2a.client.client',
49+
'a2a.client.errors',
50+
'a2a.client.helpers',
51+
'a2a.client.interceptors',
52+
'a2a.client.optionals',
53+
'a2a.client.auth',
54+
'a2a.client.transports',
55+
'a2a.server',
56+
'a2a.server.context',
57+
'a2a.server.events',
58+
'a2a.server.agent_execution',
59+
'a2a.server.request_handlers',
60+
'a2a.server.tasks',
61+
]
62+
63+
64+
def main() -> int:
65+
failures: list[str] = []
66+
successes: list[str] = []
67+
68+
for module_name in CORE_MODULES:
69+
try:
70+
importlib.import_module(module_name)
71+
successes.append(module_name)
72+
except Exception as e: # noqa: BLE001, PERF203
73+
failures.append(f'{module_name}: {e}')
74+
75+
print(f'Tested {len(CORE_MODULES)} core modules')
76+
print(f' Passed: {len(successes)}')
77+
print(f' Failed: {len(failures)}')
78+
79+
if failures:
80+
print('\nFAILED imports:')
81+
for failure in failures:
82+
print(f' - {failure}')
83+
return 1
84+
85+
print('\nAll core modules imported successfully.')
86+
return 0
87+
88+
89+
if __name__ == '__main__':
90+
sys.exit(main())

0 commit comments

Comments
 (0)