Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/google/adk/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .cli_tools_click import main
from typing import Any

from .cli_tools_click import main as _main


def main(args: Any = None, **kwargs: Any) -> Any:
"""Package entry point that disables Windows glob expansion for all CLI commands."""

kwargs.setdefault("windows_expand_args", False)
return _main.main(args=args, **kwargs)
3 changes: 2 additions & 1 deletion src/google/adk/cli/cli_tools_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from .. import version
from ..agents.run_config import StreamingMode
from ..evaluation.constants import MISSING_EVAL_DEPENDENCIES_MESSAGE
from ..evaluation.eval_result import EvalCaseResult
from ..features import FeatureName
from ..features import override_feature_enabled
from .cli import run_cli
Expand Down Expand Up @@ -1131,7 +1132,7 @@ def cli_eval(
inference_requests=inference_requests, eval_service=eval_service
)
)
eval_results = asyncio.run(
eval_results: list[EvalCaseResult] = asyncio.run(
_collect_eval_results(
inference_results=inference_results,
eval_service=eval_service,
Expand Down
9 changes: 9 additions & 0 deletions tests/unittests/cli/utils/test_cli_tools_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ def _mute_click(request, monkeypatch: pytest.MonkeyPatch) -> None:
# monkeypatch.setattr(click, "secho", lambda *a, **k: None)


def test_main_disables_click_windows_glob_expansion() -> None:
"""Verifies the ADK CLI disables Click's Windows glob expansion."""
with mock.patch.object(click.Group, "main", return_value=None) as mock_main:
from google.adk.cli import main

main(args=["web", ".", "--allow_origins", "*"])
assert mock_main.call_args.kwargs["windows_expand_args"] is False


# validate_exclusive
def test_validate_exclusive_allows_single() -> None:
"""Providing exactly one exclusive option should pass."""
Expand Down
Loading