Skip to content

Commit

Permalink
Make command tree a bit deeper
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Aug 31, 2023
1 parent 05ad426 commit ec4b29e
Showing 1 changed file with 49 additions and 31 deletions.
80 changes: 49 additions & 31 deletions release_management/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
)
Expand All @@ -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


Expand Down

0 comments on commit ec4b29e

Please sign in to comment.