Skip to content

Commit 020683b

Browse files
GWealecopybara-github
authored andcommitted
chore: internal changes
Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 929293376
1 parent 1ff0158 commit 020683b

11 files changed

Lines changed: 28 additions & 25 deletions

File tree

src/google/adk/cli/cli_tools_click.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ def cli_generate_eval_cases(
14901490
click.echo("Generating scenarios utilizing Vertex AI Eval SDK...")
14911491
scenarios = generator.generate_scenarios(root_agent, config)
14921492

1493-
# TODO(pthodoroff): Expose initial session state when simulation library
1493+
# TODO: Expose initial session state when simulation library
14941494
# supports it.
14951495
initial_session_state = create_empty_state(root_agent)
14961496

src/google/adk/tools/_function_parameter_parse_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _raise_for_any_of_if_mldev(schema: types.Schema):
149149

150150
def _update_for_default_if_mldev(schema: types.Schema):
151151
if schema.default is not None:
152-
# TODO(kech): Remove this workaround once mldev supports default value.
152+
# TODO: Remove this workaround once mldev supports default value.
153153
schema.default = None
154154
logger.warning(
155155
'Default value is not supported in function declaration schema for'

src/google/adk/tools/application_integration_tool/application_integration_toolset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
logger = logging.getLogger("google_adk." + __name__)
4343

4444

45-
# TODO(cheliu): Apply a common toolset interface
45+
# TODO: Apply a common toolset interface
4646
class ApplicationIntegrationToolset(BaseToolset):
4747
"""ApplicationIntegrationToolset generates tools from a given Application
4848
Integration or Integration Connector resource.

src/google/adk/tools/function_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ async def _invoke_callable(
297297
else:
298298
return target(**args_to_call)
299299

300-
# TODO(hangfei): fix call live for function stream.
300+
# TODO: fix call live for function stream.
301301
async def _call_live(
302302
self,
303303
*,

src/google/adk/tools/openapi_tool/auth/auth_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def credential_to_param(
364364
kwargs = {param.py_name: auth_credential.api_key}
365365
return param, kwargs
366366

367-
# TODO(cheliu): Split handling for OpenIDConnect scheme and native HTTPBearer
367+
# TODO: Split handling for OpenIDConnect scheme and native HTTPBearer
368368
# Scheme
369369
elif (
370370
auth_credential and auth_credential.auth_type == AuthCredentialTypes.HTTP

src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def exchange_credential(
103103
Raises:
104104
ValueError: If the auth scheme or auth credential is invalid.
105105
"""
106-
# TODO(cheliu): Implement token refresh flow
106+
# TODO: Implement token refresh flow
107107

108108
self._check_scheme_credential_type(auth_scheme, auth_credential)
109109

src/google/adk/tools/openapi_tool/common/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def generate_return_doc(responses: Dict[str, Response]) -> str:
244244
content = response_details.content or {}
245245

246246
# Generate return type hint and properties for the first response type.
247-
# TODO(cheliu): Handle multiple content types.
247+
# TODO: Handle multiple content types.
248248
for _, schema_details in content.items():
249249
schema = schema_details.schema_ or {}
250250

tests/integration/integrations/agent_identity/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ Verifies OAuth flows using GCP Agent Identity Credentials service.
44

55
## Setup
66

7-
To set up your environment for the first time, run the `uv` setup script:
8-
```bash
9-
cd open_source_workspace
10-
./uv_setup.sh
11-
```
12-
13-
Then, activate the virtual environment:
7+
To set up your environment for the first time, create a virtual environment
8+
and install dependencies:
149
```bash
10+
uv venv --python "python3.11" ".venv"
1511
source .venv/bin/activate
12+
uv sync --all-extras
1613
```
1714

1815
Then, install test specific packages

tests/unittests/test_optional_dependencies.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ def test_vertex_ai_session_service_fails_on_creation():
170170

171171
def test_vertexai_dependency_shim_raises_clear_importerror():
172172
"""Verify that the Vertex AI dependency shim points users to the dependency."""
173+
module_path = _REPO_ROOT / "dependencies_internal/vertexai.py"
174+
if not module_path.is_file():
175+
pytest.skip("Vertex AI dependency shim is not present in this build.")
173176
with mock.patch.dict("sys.modules", {"google.cloud.aiplatform": None}):
174-
module_path = _REPO_ROOT / "dependencies_internal/vertexai.py"
175177
spec = importlib.util.spec_from_file_location(
176178
"_test_google_adk_dependencies_vertexai", module_path
177179
)

tests/unittests/test_release_dependencies.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,23 @@
4141
def _find_pyproject() -> Path:
4242
"""Locates pyproject.toml by walking up from this file's directory.
4343
44-
Works in both layouts:
45-
* Open-source: pyproject.toml lives at the repo root.
46-
* google3: pyproject.toml lives under open_source_workspace/ and tests/ is
47-
a symlink into the package root, so .resolve() lands in the wrong place.
44+
Handles layouts where pyproject.toml is at an ancestor directory as well as
45+
layouts where it lives in a sibling build directory next to the package. The
46+
test tree may be symlinked, so the walk avoids ``.resolve()``.
4847
"""
4948
start = Path(__file__).parent
5049
for candidate in [start, *start.parents]:
5150
direct = candidate / 'pyproject.toml'
5251
if direct.is_file():
5352
return direct
54-
sibling = candidate / 'open_source_workspace' / 'pyproject.toml'
55-
if sibling.is_file():
56-
return sibling
53+
try:
54+
children = sorted(p for p in candidate.iterdir() if p.is_dir())
55+
except OSError:
56+
continue
57+
for child in children:
58+
sibling = child / 'pyproject.toml'
59+
if sibling.is_file():
60+
return sibling
5761
raise FileNotFoundError(
5862
f'Could not find pyproject.toml walking up from {start}.'
5963
)
@@ -105,8 +109,8 @@ def test_environment_simulation_config_imports_validation_error_from_pydantic()
105109
pydantic-core is undeclared; importing from it directly is fragile. pydantic
106110
re-exports ValidationError, so use that.
107111
"""
108-
# Use importlib to locate the source file so the test works in both the
109-
# open-source layout (src/google/adk/...) and inside google3 (flat layout).
112+
# Use importlib to locate the source file so the test is independent of the
113+
# on-disk package layout.
110114
spec = importlib.util.find_spec(
111115
'google.adk.tools.environment_simulation.environment_simulation_config'
112116
)

0 commit comments

Comments
 (0)