diff --git a/src/google/adk/cli/cli_tools_click.py b/src/google/adk/cli/cli_tools_click.py index 3f2fe370..a5a0d909 100644 --- a/src/google/adk/cli/cli_tools_click.py +++ b/src/google/adk/cli/cli_tools_click.py @@ -1490,7 +1490,7 @@ def cli_generate_eval_cases( click.echo("Generating scenarios utilizing Vertex AI Eval SDK...") scenarios = generator.generate_scenarios(root_agent, config) - # TODO(pthodoroff): Expose initial session state when simulation library + # TODO: Expose initial session state when simulation library # supports it. initial_session_state = create_empty_state(root_agent) diff --git a/src/google/adk/tools/_function_parameter_parse_util.py b/src/google/adk/tools/_function_parameter_parse_util.py index 096264de..e61b61db 100644 --- a/src/google/adk/tools/_function_parameter_parse_util.py +++ b/src/google/adk/tools/_function_parameter_parse_util.py @@ -149,7 +149,7 @@ def _raise_for_any_of_if_mldev(schema: types.Schema): def _update_for_default_if_mldev(schema: types.Schema): if schema.default is not None: - # TODO(kech): Remove this workaround once mldev supports default value. + # TODO: Remove this workaround once mldev supports default value. schema.default = None logger.warning( 'Default value is not supported in function declaration schema for' diff --git a/src/google/adk/tools/application_integration_tool/application_integration_toolset.py b/src/google/adk/tools/application_integration_tool/application_integration_toolset.py index e4e2c5dd..b8565f6b 100644 --- a/src/google/adk/tools/application_integration_tool/application_integration_toolset.py +++ b/src/google/adk/tools/application_integration_tool/application_integration_toolset.py @@ -42,7 +42,7 @@ from .integration_connector_tool import IntegrationConnectorTool logger = logging.getLogger("google_adk." + __name__) -# TODO(cheliu): Apply a common toolset interface +# TODO: Apply a common toolset interface class ApplicationIntegrationToolset(BaseToolset): """ApplicationIntegrationToolset generates tools from a given Application Integration or Integration Connector resource. diff --git a/src/google/adk/tools/function_tool.py b/src/google/adk/tools/function_tool.py index 21aa6bfd..47b258e5 100644 --- a/src/google/adk/tools/function_tool.py +++ b/src/google/adk/tools/function_tool.py @@ -297,7 +297,7 @@ You could retry calling this tool, but it is IMPORTANT for you to provide all th else: return target(**args_to_call) - # TODO(hangfei): fix call live for function stream. + # TODO: fix call live for function stream. async def _call_live( self, *, diff --git a/src/google/adk/tools/openapi_tool/auth/auth_helpers.py b/src/google/adk/tools/openapi_tool/auth/auth_helpers.py index e8eba69a..2c8ae5bb 100644 --- a/src/google/adk/tools/openapi_tool/auth/auth_helpers.py +++ b/src/google/adk/tools/openapi_tool/auth/auth_helpers.py @@ -364,7 +364,7 @@ def credential_to_param( kwargs = {param.py_name: auth_credential.api_key} return param, kwargs - # TODO(cheliu): Split handling for OpenIDConnect scheme and native HTTPBearer + # TODO: Split handling for OpenIDConnect scheme and native HTTPBearer # Scheme elif ( auth_credential and auth_credential.auth_type == AuthCredentialTypes.HTTP diff --git a/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py b/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py index 91f39096..4bdcd3e5 100644 --- a/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py +++ b/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py @@ -103,7 +103,7 @@ class OAuth2CredentialExchanger(BaseAuthCredentialExchanger): Raises: ValueError: If the auth scheme or auth credential is invalid. """ - # TODO(cheliu): Implement token refresh flow + # TODO: Implement token refresh flow self._check_scheme_credential_type(auth_scheme, auth_credential) diff --git a/src/google/adk/tools/openapi_tool/common/common.py b/src/google/adk/tools/openapi_tool/common/common.py index b2fa161e..3b9b6b24 100644 --- a/src/google/adk/tools/openapi_tool/common/common.py +++ b/src/google/adk/tools/openapi_tool/common/common.py @@ -244,7 +244,7 @@ class PydocHelper: content = response_details.content or {} # Generate return type hint and properties for the first response type. - # TODO(cheliu): Handle multiple content types. + # TODO: Handle multiple content types. for _, schema_details in content.items(): schema = schema_details.schema_ or {} diff --git a/tests/integration/integrations/agent_identity/README.md b/tests/integration/integrations/agent_identity/README.md index a732b871..0d8ade1f 100644 --- a/tests/integration/integrations/agent_identity/README.md +++ b/tests/integration/integrations/agent_identity/README.md @@ -4,15 +4,12 @@ Verifies OAuth flows using GCP Agent Identity Credentials service. ## Setup -To set up your environment for the first time, run the `uv` setup script: -```bash -cd open_source_workspace -./uv_setup.sh -``` - -Then, activate the virtual environment: +To set up your environment for the first time, create a virtual environment +and install dependencies: ```bash +uv venv --python "python3.11" ".venv" source .venv/bin/activate +uv sync --all-extras ``` Then, install test specific packages diff --git a/tests/unittests/test_optional_dependencies.py b/tests/unittests/test_optional_dependencies.py index 7a0b4d56..c84cf615 100644 --- a/tests/unittests/test_optional_dependencies.py +++ b/tests/unittests/test_optional_dependencies.py @@ -170,8 +170,10 @@ def test_vertex_ai_session_service_fails_on_creation(): def test_vertexai_dependency_shim_raises_clear_importerror(): """Verify that the Vertex AI dependency shim points users to the dependency.""" + module_path = _REPO_ROOT / "dependencies_internal/vertexai.py" + if not module_path.is_file(): + pytest.skip("Vertex AI dependency shim is not present in this build.") with mock.patch.dict("sys.modules", {"google.cloud.aiplatform": None}): - module_path = _REPO_ROOT / "dependencies_internal/vertexai.py" spec = importlib.util.spec_from_file_location( "_test_google_adk_dependencies_vertexai", module_path ) diff --git a/tests/unittests/test_release_dependencies.py b/tests/unittests/test_release_dependencies.py index bcb4f043..04098ff2 100644 --- a/tests/unittests/test_release_dependencies.py +++ b/tests/unittests/test_release_dependencies.py @@ -41,19 +41,23 @@ import pytest def _find_pyproject() -> Path: """Locates pyproject.toml by walking up from this file's directory. - Works in both layouts: - * Open-source: pyproject.toml lives at the repo root. - * google3: pyproject.toml lives under open_source_workspace/ and tests/ is - a symlink into the package root, so .resolve() lands in the wrong place. + Handles layouts where pyproject.toml is at an ancestor directory as well as + layouts where it lives in a sibling build directory next to the package. The + test tree may be symlinked, so the walk avoids ``.resolve()``. """ start = Path(__file__).parent for candidate in [start, *start.parents]: direct = candidate / 'pyproject.toml' if direct.is_file(): return direct - sibling = candidate / 'open_source_workspace' / 'pyproject.toml' - if sibling.is_file(): - return sibling + try: + children = sorted(p for p in candidate.iterdir() if p.is_dir()) + except OSError: + continue + for child in children: + sibling = child / 'pyproject.toml' + if sibling.is_file(): + return sibling raise FileNotFoundError( f'Could not find pyproject.toml walking up from {start}.' ) @@ -105,8 +109,8 @@ def test_environment_simulation_config_imports_validation_error_from_pydantic() pydantic-core is undeclared; importing from it directly is fragile. pydantic re-exports ValidationError, so use that. """ - # Use importlib to locate the source file so the test works in both the - # open-source layout (src/google/adk/...) and inside google3 (flat layout). + # Use importlib to locate the source file so the test is independent of the + # on-disk package layout. spec = importlib.util.find_spec( 'google.adk.tools.environment_simulation.environment_simulation_config' ) diff --git a/tests/unittests/tools/test_agent_tool.py b/tests/unittests/tools/test_agent_tool.py index 4c664ae8..17c34225 100644 --- a/tests/unittests/tools/test_agent_tool.py +++ b/tests/unittests/tools/test_agent_tool.py @@ -374,7 +374,7 @@ async def test_update_artifacts(): 'env_variables', [ 'GOOGLE_AI', - # TODO(wanyif): re-enable after fix. + # TODO: re-enable after fix. # 'VERTEX', ], indirect=True,