2626import sys
2727import tempfile
2828import textwrap
29- from typing import Any
30- from typing import cast
29+ from typing import Optional
3130
3231import click
3332from click .core import ParameterSource
4847 case_sensitive = False ,
4948)
5049
51- _ClickGroup = cast (type [Any ], click .Group )
52-
53-
54- class _NoWindowsGlobExpansionGroup (_ClickGroup ):
55- """Click group that disables Windows glob expansion for CLI arguments."""
56-
57- def main (self , * args : Any , ** kwargs : Any ) -> Any :
58- kwargs .setdefault ("windows_expand_args" , False )
59- return super ().main (* args , ** kwargs )
60-
6150
6251def _logging_options ():
6352 """Decorator to add logging options to click commands."""
@@ -247,10 +236,7 @@ def _warn_if_with_ui(with_ui: bool) -> None:
247236 click .secho (f"WARNING: { _ADK_WEB_WARNING } " , fg = "yellow" , err = True )
248237
249238
250- @click .group (
251- cls = _NoWindowsGlobExpansionGroup ,
252- context_settings = {"max_content_width" : 240 },
253- )
239+ @click .group (context_settings = {"max_content_width" : 240 })
254240@click .version_option (version .__version__ )
255241def main ():
256242 """Agent Development Kit CLI tools."""
@@ -1159,7 +1145,7 @@ def cli_eval(
11591145 inference_requests = inference_requests , eval_service = eval_service
11601146 )
11611147 )
1162- eval_results = asyncio .run (
1148+ eval_results : list [ EvalCaseResult ] = asyncio .run (
11631149 _collect_eval_results (
11641150 inference_results = inference_results ,
11651151 eval_service = eval_service ,
@@ -1175,7 +1161,6 @@ def cli_eval(
11751161 eval_run_summary = {}
11761162
11771163 for eval_result in eval_results :
1178- eval_result : EvalCaseResult
11791164
11801165 if eval_result .eval_set_id not in eval_run_summary :
11811166 eval_run_summary [eval_result .eval_set_id ] = [0 , 0 ]
@@ -1193,7 +1178,6 @@ def cli_eval(
11931178
11941179 if print_detailed_results :
11951180 for eval_result in eval_results :
1196- eval_result : EvalCaseResult
11971181 click .echo (
11981182 "********************************************************************"
11991183 )
@@ -2015,7 +1999,6 @@ def cli_api_server(
20151999 "cloud_run" ,
20162000 context_settings = {
20172001 "allow_extra_args" : True ,
2018- "allow_interspersed_args" : False ,
20192002 },
20202003)
20212004@click .option (
@@ -2192,34 +2175,7 @@ def cli_deploy_cloud_run(
21922175
21932176 _warn_if_with_ui (with_ui )
21942177
2195- # Parse arguments to separate gcloud args (after --) from regular args
2196- gcloud_args = []
2197- if "--" in ctx .args :
2198- separator_index = ctx .args .index ("--" )
2199- gcloud_args = ctx .args [separator_index + 1 :]
2200- regular_args = ctx .args [:separator_index ]
2201-
2202- # If there are regular args before --, that's an error
2203- if regular_args :
2204- click .secho (
2205- "Error: Unexpected arguments after agent path and before '--':"
2206- f" { ' ' .join (regular_args )} . \n Only arguments after '--' are passed"
2207- " to gcloud." ,
2208- fg = "red" ,
2209- err = True ,
2210- )
2211- ctx .exit (2 )
2212- else :
2213- # No -- separator, treat all args as an error to enforce the new behavior
2214- if ctx .args :
2215- click .secho (
2216- f"Error: Unexpected arguments: { ' ' .join (ctx .args )} . \n Use '--' to"
2217- " separate gcloud arguments, e.g.: adk deploy cloud_run [options]"
2218- " agent_path -- --min-instances=2" ,
2219- fg = "red" ,
2220- err = True ,
2221- )
2222- ctx .exit (2 )
2178+ gcloud_args = ctx .args
22232179
22242180 try :
22252181 from . import cli_deploy
0 commit comments