Skip to content

integrations: gcs, secret_manager and parameter_manager import google-cloud clients at module level, violating the lazy-import contract #7580

Closed as not planned

Description

@apercivall

Describe the bug

integrations/README.md requires each integration to import its optional third-party dependency lazily and raise a descriptive error pointing at the extra to install. Three GCP integrations do not follow this:

  • google/adk/integrations/gcs/client.py - from google.cloud import storage and import google.api_core.client_info at module level
  • google/adk/integrations/secret_manager/secret_client.py - from google.cloud import secretmanager and from google.api_core.gapic_v1 import client_info at module level
  • google/adk/integrations/parameter_manager/parameter_client.py - from google.cloud import parametermanager_v1 and from google.api_core.gapic_v1 import client_info at module level

google-cloud-storage, google-cloud-secret-manager, google-cloud-parametermanager and google-api-core are only in the gcp / all extras, not core dependencies.

To Reproduce

python -m venv v && v/bin/pip install google-adk
v/bin/python -c "import google.adk.integrations.secret_manager"
# ModuleNotFoundError: No module named 'google.api_core'

Same for google.adk.integrations.parameter_manager and google.adk.integrations.gcs.

Expected behavior

The modules import without the gcp extra, and the first use (constructing SecretManagerClient / ParameterManagerClient, calling get_gcs_client) raises an ImportError that says to run pip install 'google-adk[gcp]', like integrations/model_armor and integrations/mongodb already do.

Desktop

  • google-adk 2.12.0, Python 3.11

I am working on a fix (Googler, change coming via the internal repo).

Activity

  1. apercivall commented on Oct 16, 2026

    @apercivall
    ContributorAuthor

    Duplicate of #7581 (created twice by a CLI retry). Tracking there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions