@@ -374,11 +374,11 @@ def synthesize_loop(
374374 youngest = len (toolbox .versions ) - 1
375375 has_changes = toolbox .synthesize_version_in_new_branch (synthesizer , youngest )
376376 if not has_changes :
377- if not toolbox . metadata_contains_generated_files (
378- toolbox .branch
379- ) and toolbox .metadata_contains_generated_files (
380- toolbox . sub_branch ( youngest )
381- ) and not change_pusher . check_if_pr_already_exists ( toolbox . branch ) :
377+ if (
378+ not toolbox .metadata_contains_generated_files ( toolbox . branch )
379+ and toolbox .metadata_contains_generated_files (toolbox . sub_branch ( youngest ))
380+ and not change_pusher . check_if_pr_already_exists ( toolbox . branch )
381+ ):
382382 # Special case: the repo owner turned on obsolete file tracking.
383383 # Generate a one-time PR containing only metadata changes.
384384 executor .check_call (["git" , "checkout" , toolbox .branch ])
@@ -553,7 +553,16 @@ def _inner_main(temp_dir: str) -> int:
553553 parser .add_argument (
554554 "--repository" , default = os .environ .get ("REPOSITORY" ), required = True
555555 )
556- parser .add_argument ("--synth-path" , default = os .environ .get ("SYNTH_PATH" ))
556+ parser .add_argument (
557+ "--synth-path" ,
558+ default = os .environ .get ("SYNTH_PATH" ),
559+ help = "If specified, changes the directory from which synthtool is invoked." ,
560+ )
561+ parser .add_argument (
562+ "--synth-file-name" ,
563+ default = os .environ .get ("SYNTH_FILE_NAME" ),
564+ help = "If specified, override the synth file name and may be a path to a file. Defaults to 'synth.py'." ,
565+ )
557566 parser .add_argument ("--metadata-path" , default = os .environ .get ("METADATA_PATH" ))
558567 parser .add_argument ("--base-log-dir" , default = "" )
559568 parser .add_argument (
@@ -579,6 +588,7 @@ def _inner_main(temp_dir: str) -> int:
579588 f"the API or client library generator."
580589 )
581590 change_pusher : AbstractChangePusher = ChangePusher (args .repository , gh , branch )
591+ synth_file_name = args .synth_file_name or "synth.py"
582592
583593 # capture logs for later
584594 # The logs directory path will be rendered in Sponge and Fusion as the test name,
@@ -629,6 +639,7 @@ def _inner_main(temp_dir: str) -> int:
629639 metadata_path ,
630640 args .extra_args ,
631641 deprecated_execution = args .deprecated_execution ,
642+ synth_py_path = synth_file_name ,
632643 ).synthesize (synth_log_path / "sponge_log.log" )
633644
634645 if not has_changes ():
@@ -655,7 +666,10 @@ def _inner_main(temp_dir: str) -> int:
655666
656667 # Prepare to call synthesize loop.
657668 synthesizer = Synthesizer (
658- metadata_path , args .extra_args , args .deprecated_execution , "synth.py" ,
669+ metadata_path ,
670+ args .extra_args ,
671+ deprecated_execution = args .deprecated_execution ,
672+ synth_py_path = synth_file_name ,
659673 )
660674 x = SynthesizeLoopToolbox (
661675 source_versions ,
0 commit comments