fix(cli): lazy-import GCS deps so adk web works without google-cloud-storage#5789
fix(cli): lazy-import GCS deps so adk web works without google-cloud-storage#5789mangod12 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Response from ADK Triaging Agent Hello @mangod12, thank you for creating this PR! We noticed that the Google Contributor License Agreement (CLA) check has failed for this pull request. According to our Contribution Guidelines, all contributions to this project must be accompanied by a signed CLA before they can be reviewed and accepted. Please visit https://cla.developers.google.com/ to sign the agreement. Once signed, the check should update automatically. Thank you! |
c69c3aa to
f7c7b03
Compare
…d-storage The `DevServer` import chain unconditionally imported `gcs_eval_set_results_manager` and `gcs_eval_sets_manager` at module level, which require `google-cloud-storage`. This caused `adk web` to silently fall back to `ApiServer` on a fresh `pip install google-adk`, leaving the dev UI unreachable. Fix: move GCS imports behind `TYPE_CHECKING` for type annotations and lazy-import inside `create_gcs_eval_managers_from_uri()` where they are actually needed. Also add `python-multipart` to core dependencies since it is required for Builder UI endpoints in `adk web`. Fixes google#5787
f7c7b03 to
06a1169
Compare
Summary
google.adk.cli.utils.evalssoDevServerimports successfully withoutgoogle-cloud-storageinstalledpython-multipartto core dependencies since it's required for Builder UI endpoints inadk webRoot cause
evals.pyunconditionally importsGcsEvalSetResultsManagerandGcsEvalSetsManagerat module level. These modules importgoogle.cloud.storage, which is only declared under[gcp]/[all]/[test]extras. Sincedev_server.pyimportsevals, a freshpip install google-adkcausesDevServerto fail to import, silently falling back toApiServer— leaving the dev UI at/dev-ui/unreachable (404).Changes
src/google/adk/cli/utils/evals.py— moved GCS imports behindTYPE_CHECKINGfor annotations and lazy-import insidecreate_gcs_eval_managers_from_uri()where they're actually neededpyproject.toml— addedpython-multipart>=0.0.9to core dependenciestests/unittests/cli/utils/test_evals.py— updated mock paths and added regression test verifying GCS classes are not in module namespace at runtimeTest plan
test_evals.pypass (existing + new regression test)from google.adk.cli.dev_server import DevServersucceedsfast_api.py(lines 519-531) forDevServeritselfFixes #5787
🤖 Generated with Claude Code