1212from pipelex .builder .builder_loop import BuilderLoop
1313from pipelex .builder .runner_code import generate_runner_code
1414from pipelex .cli .cli_factory import make_pipelex_for_cli
15+ from pipelex .cli .commands .build .structures_cmd import generate_structures_from_blueprints
1516from pipelex .cli .error_handlers import (
1617 ErrorContext ,
1718 handle_model_availability_error ,
@@ -153,9 +154,9 @@ def build_pipe_cmd(
153154 typer .Option ("--no-extras" , help = "Skip generating inputs.json and runner.py, only generate the PLX file" ),
154155 ] = False ,
155156 graph : Annotated [
156- bool ,
157+ bool | None ,
157158 typer .Option ("--graph/--no-graph" , help = "Generate execution graphs for both build process and built pipeline" ),
158- ] = True ,
159+ ] = None ,
159160 graph_full_data : Annotated [
160161 bool | None ,
161162 typer .Option (
@@ -172,9 +173,6 @@ def build_pipe_cmd(
172173 ),
173174 ] = None ,
174175) -> None :
175- # Import here to avoid circular imports
176- from pipelex .cli .commands .build .structures_cmd import generate_structures_from_blueprints # noqa: PLC0415
177-
178176 make_pipelex_for_cli (context = ErrorContext .VALIDATION_BEFORE_BUILD_PIPE )
179177
180178 typer .secho ("🔥 Starting pipe builder... 🚀\n " , fg = typer .colors .GREEN )
@@ -304,8 +302,8 @@ async def run_pipeline():
304302 save_text_to_path (text = "" , path = init_path )
305303 typer .secho (f"✅ Package init file saved to: { init_path } " , fg = typer .colors .GREEN )
306304
307- # Generate graphs if --graph is enabled
308- if graph and builder_graph_spec :
305+ # Generate graphs if it was tracked during the build process
306+ if builder_graph_spec :
309307 typer .secho ("\n 📊 Generating graphs..." , fg = typer .colors .CYAN )
310308
311309 # Save builder pipeline graph in graphs/ subfolder
0 commit comments