5757from easybuild .tools .containers .common import containerize
5858from easybuild .tools .docs import list_software
5959from easybuild .tools .filetools import adjust_permissions , cleanup , write_file
60- from easybuild .tools .github import check_github , find_easybuild_easyconfig , install_github_token
61- from easybuild .tools .github import close_pr , list_prs , new_pr , merge_pr , sync_pr_with_develop , update_pr
60+ from easybuild .tools .github import check_github , close_pr , new_branch_github , find_easybuild_easyconfig
61+ from easybuild .tools .github import install_github_token , list_prs , new_pr , new_pr_from_branch , merge_pr
62+ from easybuild .tools .github import sync_branch_with_develop , sync_pr_with_develop , update_branch , update_pr
6263from easybuild .tools .hooks import START , END , load_hooks , run_hook
6364from easybuild .tools .modules import modules_tool
6465from easybuild .tools .options import set_up_configuration , use_color
@@ -293,7 +294,9 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None):
293294 categorized_paths = categorize_files_by_type (orig_paths )
294295
295296 # command line options that do not require any easyconfigs to be specified
296- pr_options = options .new_pr or options .preview_pr or options .sync_pr_with_develop or options .update_pr
297+ pr_options = options .new_branch_github or options .new_pr or options .new_pr_from_branch or options .preview_pr
298+ pr_options = pr_options or options .sync_branch_with_develop or options .sync_pr_with_develop
299+ pr_options = pr_options or options .update_branch_github or options .update_pr
297300 no_ec_opts = [options .aggregate_regtest , options .regtest , pr_options , search_query ]
298301
299302 # determine paths to easyconfigs
@@ -306,16 +309,15 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None):
306309 if determined_paths :
307310 # transform paths into tuples, use 'False' to indicate the corresponding easyconfig files were not generated
308311 paths = [(p , False ) for p in determined_paths ]
312+ elif 'name' in build_specs :
313+ # try to obtain or generate an easyconfig file via build specifications if a software name is provided
314+ paths = find_easyconfigs_by_specs (build_specs , robot_path , try_to_generate , testing = testing )
315+ elif any (no_ec_opts ):
316+ paths = determined_paths
309317 else :
310- if 'name' in build_specs :
311- # try to obtain or generate an easyconfig file via build specifications if a software name is provided
312- paths = find_easyconfigs_by_specs (build_specs , robot_path , try_to_generate , testing = testing )
313- elif any (no_ec_opts ):
314- paths = determined_paths
315- else :
316- print_error (("Please provide one or multiple easyconfig files, or use software build "
317- "options to make EasyBuild search for easyconfigs" ),
318- log = _log , opt_parser = eb_go .parser , exit_on_error = not testing )
318+ print_error ("Please provide one or multiple easyconfig files, or use software build " +
319+ "options to make EasyBuild search for easyconfigs" ,
320+ log = _log , opt_parser = eb_go .parser , exit_on_error = not testing )
319321 _log .debug ("Paths: %s" , paths )
320322
321323 # run regtest
@@ -385,14 +387,21 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None):
385387 # creating/updating PRs
386388 if pr_options :
387389 if options .new_pr :
388- new_pr (categorized_paths , ordered_ecs , title = options .pr_title , descr = options .pr_descr ,
389- commit_msg = options .pr_commit_msg )
390+ new_pr (categorized_paths , ordered_ecs )
391+ elif options .new_branch_github :
392+ new_branch_github (categorized_paths , ordered_ecs )
393+ elif options .new_pr_from_branch :
394+ new_pr_from_branch (options .new_pr_from_branch )
390395 elif options .preview_pr :
391396 print (review_pr (paths = determined_paths , colored = use_color (options .color )))
397+ elif options .sync_branch_with_develop :
398+ sync_branch_with_develop (options .sync_branch_with_develop )
392399 elif options .sync_pr_with_develop :
393400 sync_pr_with_develop (options .sync_pr_with_develop )
401+ elif options .update_branch_github :
402+ update_branch (options .update_branch_github , categorized_paths , ordered_ecs )
394403 elif options .update_pr :
395- update_pr (options .update_pr , categorized_paths , ordered_ecs , commit_msg = options . pr_commit_msg )
404+ update_pr (options .update_pr , categorized_paths , ordered_ecs )
396405 else :
397406 raise EasyBuildError ("Unknown PR option!" )
398407
0 commit comments