From 68c75b9883d698c43bfba78e4d0cbd50d3b1cf0b Mon Sep 17 00:00:00 2001 From: Amy Wu Date: Thu, 27 Aug 2026 11:07:20 -0700 Subject: [PATCH] chore: Ship agentplatform.frameworks in the google-cloud-agentplatform wheel PiperOrigin-RevId: 972051517 --- .../google_cloud_agentplatform/pyproject.toml | 31 +++++++++++++++---- .../verify_imports.py | 19 ++++++++++++ 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/pypi/google_cloud_agentplatform/pyproject.toml b/pypi/google_cloud_agentplatform/pyproject.toml index 9c8b4121f0..57257aeb3a 100644 --- a/pypi/google_cloud_agentplatform/pyproject.toml +++ b/pypi/google_cloud_agentplatform/pyproject.toml @@ -36,35 +36,54 @@ dependencies = [ [project.optional-dependencies] agent_engines = [ + "packaging >= 24.0", "cloudpickle >= 3.0, < 4.0", "google-cloud-storage >= 1.32.0, < 4.0.0", + "opentelemetry-sdk < 2", + "opentelemetry-exporter-gcp-logging >= 1.11.0a0, < 2.0.0", + "opentelemetry-exporter-otlp-proto-http < 2", + "opentelemetry-instrumentation-google-genai >= 0.3b0, < 1.0.0", + "pydantic >= 2.11.1, < 3", +] +a2a = [ + "google-cloud-agentplatform[agent_engines]", + # `set_up` imports `a2a.server.routes`, which needs the starlette and + # sse-starlette that only the http-server extra pulls in. + "a2a-sdk[http-server] >= 1.0.0", ] adk = [ "google-cloud-agentplatform[agent_engines]", - "google-adk >= 1.5.0, < 3.0.0", - "aiohttp", + "google-adk >= 1.27.0, < 3.0.0", + "aiohttp", # for ADK users to use aiohttp ] langchain = [ "google-cloud-agentplatform[agent_engines]", "langchain >= 1.0.0, < 2.0.0", + "langchain-classic", "langchain-core >= 1.0.0, < 2.0.0", - "langchain-google-genai >= 4.0.0", + "langchain-google-genai >= 4.0.0, < 4.2.3", "langgraph >= 1.0.0, < 2.0.0", + "openinference-instrumentation-langchain >= 0.1.19, < 0.2", ] ag2 = [ "google-cloud-agentplatform[agent_engines]", "autogen[gemini] >= 0.14.1, < 1", + "openinference-instrumentation-autogen >= 0.1.6, < 0.2", ] llama_index = [ "google-cloud-agentplatform[agent_engines]", "llama-index", "llama-index-llms-google-genai", + "openinference-instrumentation-llama-index >= 3.0, < 4.0", ] evaluation = [ "pandas >= 1.0.0", "tqdm >= 4.23.0", "pyyaml", - "litellm >= 1.83.7, < 1.97.0", + # Lower bound: CVE-2026-35030 plus 4 follow-on advisories patched in + # 1.83.7. Upper bound for stable interface only. + "litellm >= 1.83.7, < 1.86.0; python_version < '3.14'", + "litellm >= 1.93.0, < 1.97.0; python_version >= '3.14'", "google-cloud-storage >= 1.32.0, < 4.0.0", ] bigquery = [ @@ -76,7 +95,7 @@ live = [ "websockets", ] all = [ - "google-cloud-agentplatform[agent_engines,adk,langchain,ag2,llama_index,evaluation,bigquery,live]", + "google-cloud-agentplatform[agent_engines,a2a,adk,langchain,ag2,llama_index,evaluation,bigquery,live]", ] [tool.setuptools.dynamic] @@ -84,7 +103,7 @@ version = {attr = "agentplatform.version.__version__"} [tool.setuptools.packages.find] where = ["."] -include = ["agentplatform", "agentplatform._genai*"] +include = ["agentplatform", "agentplatform._genai*", "agentplatform.frameworks*"] exclude = [ "agentplatform.agent_engines*", "agentplatform.rag*", diff --git a/pypi/google_cloud_agentplatform/verify_imports.py b/pypi/google_cloud_agentplatform/verify_imports.py index eed2a57956..c18b5036b0 100644 --- a/pypi/google_cloud_agentplatform/verify_imports.py +++ b/pypi/google_cloud_agentplatform/verify_imports.py @@ -28,6 +28,15 @@ # both directions, and a literal one here fails its reversibility check. _PACKAGE = "agentplatform" +# Subpackages that setuptools only ships if they are listed in the +# `[tool.setuptools.packages.find] include` glob. Importing the top-level +# package does not reach them, so a missing entry there stays invisible until a +# user hits ModuleNotFoundError against the published wheel. +_SUBMODULES = ( + "frameworks", + "frameworks.a2a", +) + def main(): logging.info("Importing %s...", _PACKAGE) @@ -47,6 +56,16 @@ def main(): sys.exit(1) logging.info("Successfully instantiated %s.Client.", _PACKAGE) + for submodule in _SUBMODULES: + name = f"{_PACKAGE}.{submodule}" + logging.info("Importing %s...", name) + try: + importlib.import_module(name) + except ImportError as e: + logging.error("Failed to import %s: %s", name, e) + sys.exit(1) + logging.info("Successfully imported %s.", name) + logging.info("Verification passed.")