|
1 | | -"""Entry point: ``python -m tests.install_smoke <profile>``. |
2 | | -
|
3 | | -Exit codes: |
4 | | - 0 - All imports and runtime checks for the profile succeeded. |
5 | | - 1 - One or more imports or runtime checks failed. |
6 | | -
|
7 | | -See README.md for design notes and how to add new runtime checks. |
8 | | -""" |
| 1 | +"""Entry point for the install-smoke harness. See README.md.""" |
9 | 2 |
|
10 | 3 | from __future__ import annotations |
11 | 4 |
|
|
21 | 14 | from collections.abc import Callable |
22 | 15 |
|
23 | 16 |
|
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.). Those modules |
30 | | -# are expected to fail without their extras installed and should use |
31 | | -# try/except ImportError guards internally. |
| 17 | +# Modules under each list MUST be importable with only that profile's |
| 18 | +# extras installed -- no leakage from other extras (grpc, http-server, |
| 19 | +# sql, signing, telemetry, vertex, etc.). Modules that require |
| 20 | +# optional extras must use try/except ImportError guards internally. |
32 | 21 | CORE_MODULES = [ |
33 | 22 | 'a2a', |
34 | 23 | 'a2a.client', |
|
58 | 47 | 'a2a.helpers.proto_helpers', |
59 | 48 | ] |
60 | 49 |
|
61 | | -# Modules that MUST be importable with only the base + `http-server` |
62 | | -# extras installed (no `grpc`, `sql`, `signing`, `telemetry`, etc.). |
63 | 50 | HTTP_SERVER_MODULES = [ |
64 | 51 | 'a2a.server.routes', |
65 | 52 | 'a2a.server.routes.agent_card_routes', |
|
70 | 57 | 'a2a.server.routes.rest_routes', |
71 | 58 | ] |
72 | 59 |
|
73 | | -# Modules that MUST be importable with only the base + `grpc` extras |
74 | | -# installed (no `http-server`, `sql`, `signing`, `telemetry`, etc.). |
75 | 60 | GRPC_MODULES = [ |
76 | 61 | 'a2a.server.request_handlers.grpc_handler', |
77 | 62 | 'a2a.client.transports.grpc', |
78 | 63 | 'a2a.compat.v0_3.grpc_handler', |
79 | 64 | 'a2a.compat.v0_3.grpc_transport', |
80 | 65 | ] |
81 | 66 |
|
82 | | -# Modules that MUST be importable with only the base + `telemetry` |
83 | | -# extras installed. |
84 | 67 | TELEMETRY_MODULES = [ |
85 | 68 | 'a2a.utils.telemetry', |
86 | 69 | ] |
87 | 70 |
|
88 | | -# Modules that MUST be importable with only the base + `sql` extras |
89 | | -# installed (covers postgresql/mysql/sqlite drivers via SQLAlchemy). |
90 | 71 | SQL_MODULES = [ |
91 | 72 | 'a2a.server.models', |
92 | 73 | 'a2a.server.tasks.database_task_store', |
|
103 | 84 | } |
104 | 85 |
|
105 | 86 |
|
106 | | -# Per-profile runtime exercises. Each callable raises on failure and |
107 | | -# returns None on success. These run after the import smoke succeeds |
108 | | -# and are meant to invoke real public-API code paths against the |
109 | | -# dependency versions resolved at install time. |
110 | | -# |
111 | | -# To add a new check: drop a module under `tests.install_smoke.runtime` |
112 | | -# exposing `NAME` and `check()`, then add a tuple here for the |
113 | | -# profile(s) whose extras it needs. See README.md. |
114 | 87 | RUNTIME_CHECKS: dict[str, list[tuple[str, Callable[[], None]]]] = { |
115 | 88 | 'base': [ |
116 | 89 | (base_send_message.NAME, base_send_message.check), |
|
0 commit comments