diff --git a/release_management/create_release.py b/release_management/create_release.py index be86c13..c3d2755 100755 --- a/release_management/create_release.py +++ b/release_management/create_release.py @@ -321,37 +321,7 @@ def tag_python_library(namespace, name): ) -def _get_parser(): - """ - Build parser - """ - parser = argparse.ArgumentParser(description="Create a GitHub Draft release.") - - parser.add_argument( - "--dry-run", - action="store_true", - default=False, - dest="dry_run", - help="Only report actions, do not do them", - ) - - parser.add_argument( - "--no-tag", - action="store_true", - default=False, - dest="no_tag", - help="only create artifacts", - ) - - parser.add_argument( - "--no-release", - action="store_true", - default=False, - dest="no_release", - help="stop before pushing any changes to GitHub repo", - ) - - subparsers = parser.add_subparsers(title="subcommands") +def _create_rust_subcommands(subparsers): RustCrates.set_up_subcommand( "stratisd", @@ -390,6 +360,9 @@ def _get_parser(): RustCrates.set_up_subcommand("stratisd_proc_macros", subparsers) + +def _create_python_subcommands(subparsers): + PythonPackages.set_up_subcommand( "stratis-cli", subparsers, add_github_release_option=True ) @@ -412,6 +385,51 @@ def _get_parser(): PythonPackages.set_up_subcommand("testing", subparsers) + +def _get_parser(): + """ + Build parser + """ + parser = argparse.ArgumentParser(description="Create a GitHub Draft release.") + + parser.add_argument( + "--dry-run", + action="store_true", + default=False, + dest="dry_run", + help="Only report actions, do not do them", + ) + + parser.add_argument( + "--no-tag", + action="store_true", + default=False, + dest="no_tag", + help="only create artifacts", + ) + + parser.add_argument( + "--no-release", + action="store_true", + default=False, + dest="no_release", + help="stop before pushing any changes to GitHub repo", + ) + + subparsers = parser.add_subparsers(title="subcommands") + + rust_subparser = subparsers.add_parser( + "rust", help="Create a release for a rust package." + ) + + _create_rust_subcommands(rust_subparser) + + python_subparser = subparsers.add_parser( + "python", help="Create a release for a python package." + ) + + _create_python_subcommands(python_subparser) + return parser