@@ -285,6 +285,22 @@ def _setup_flows(
285285 setup_bundle .apply (report_to_stdout = not quiet )
286286
287287
288+ def _deprecate_setup_flag (
289+ ctx : click .Context , param : click .Parameter , value : bool
290+ ) -> bool :
291+ """Callback to warn users that --setup flag is deprecated."""
292+ if param .name is not None :
293+ param_source = ctx .get_parameter_source (param .name )
294+ if param_source == click .core .ParameterSource .COMMANDLINE :
295+ click .secho (
296+ "Warning: The --setup flag is deprecated and will be removed in a future version. "
297+ "Setup is now always enabled by default." ,
298+ fg = "yellow" ,
299+ err = True ,
300+ )
301+ return value
302+
303+
288304def _show_no_live_update_hint () -> None :
289305 click .secho (
290306 "NOTE: No change capture mechanism exists. See https://cocoindex.io/docs/core/flow_methods#live-update for more details.\n " ,
@@ -402,8 +418,9 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], force: bool) -> Non
402418 "--setup" ,
403419 is_flag = True ,
404420 show_default = True ,
405- default = False ,
406- help = "Automatically setup backends for the flow if it's not setup yet." ,
421+ default = True ,
422+ callback = _deprecate_setup_flag ,
423+ help = "(DEPRECATED) Automatically setup backends for the flow if it's not setup yet. This is now the default behavior." ,
407424)
408425@click .option (
409426 "--reset" ,
@@ -567,8 +584,9 @@ def evaluate(
567584 "--setup" ,
568585 is_flag = True ,
569586 show_default = True ,
570- default = False ,
571- help = "Automatically setup backends for the flow if it's not setup yet." ,
587+ default = True ,
588+ callback = _deprecate_setup_flag ,
589+ help = "(DEPRECATED) Automatically setup backends for the flow if it's not setup yet. This is now the default behavior." ,
572590)
573591@click .option (
574592 "--reset" ,
0 commit comments