@@ -44,6 +44,26 @@ def _parse_app_flow_specifier(specifier: str) -> tuple[str, str | None]:
44
44
)
45
45
return app_ref , flow_ref_part
46
46
47
+ def _get_app_ref_from_specifier (
48
+ specifier : str ,
49
+ ) -> str :
50
+ """
51
+ Parses the APP_TARGET to get the application reference (path or module).
52
+ Issues a warning if a flow name component is also provided in it.
53
+ """
54
+ app_ref , flow_ref = _parse_app_flow_specifier (specifier )
55
+
56
+ if flow_ref is not None :
57
+ click .echo (
58
+ click .style (
59
+ f"Ignoring flow name '{ flow_ref } ' in '{ specifier } ': "
60
+ f"this command operates on the entire app/module '{ app_ref } '." ,
61
+ fg = 'yellow'
62
+ ),
63
+ err = True
64
+ )
65
+ return app_ref
66
+
47
67
def _load_user_app (app_target : str ) -> types .ModuleType :
48
68
"""
49
69
Loads the user's application, which can be a file path or an installed module name.
@@ -111,7 +131,7 @@ def ls(app_target: str | None):
111
131
setup in the backend.
112
132
"""
113
133
if app_target :
114
- app_ref , _ = _parse_app_flow_specifier (app_target )
134
+ app_ref = _get_app_ref_from_specifier (app_target )
115
135
_load_user_app (app_ref )
116
136
117
137
current_flow_names = set (flow .flow_names ())
@@ -189,7 +209,7 @@ def setup(app_target: str):
189
209
190
210
APP_TARGET: path/to/app.py or installed_module.
191
211
"""
192
- app_ref , _ = _parse_app_flow_specifier (app_target ) # Ignore flow name for setup
212
+ app_ref = _get_app_ref_from_specifier (app_target )
193
213
_load_user_app (app_ref )
194
214
195
215
setup_status = sync_setup ()
@@ -227,7 +247,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
227
247
click .echo ("Warning: When --all is used, APP_TARGET and any individual flow names are ignored." , err = True )
228
248
flow_names = flow_names_with_setup ()
229
249
elif app_target :
230
- app_ref , _ = _parse_app_flow_specifier (app_target ) # Ignore any :FlowName part
250
+ app_ref = _get_app_ref_from_specifier (app_target )
231
251
_load_user_app (app_ref )
232
252
if flow_name :
233
253
flow_names = list (flow_name )
@@ -352,7 +372,7 @@ def server(app_target: str, address: str | None, live_update: bool, quiet: bool,
352
372
353
373
APP_TARGET: path/to/app.py or installed_module.
354
374
"""
355
- app_ref , _ = _parse_app_flow_specifier (app_target ) # Ignore flow name for server
375
+ app_ref = _get_app_ref_from_specifier (app_target )
356
376
_load_user_app (app_ref )
357
377
358
378
server_settings = setting .ServerSettings .from_env ()
0 commit comments