Skip to content

Commit

Permalink
Merge pull request #460 from mulkieran/issue_ci_457
Browse files Browse the repository at this point in the history
Issue ci 457
  • Loading branch information
mulkieran authored Aug 31, 2023
2 parents 5b6d5f6 + ec4b29e commit e77750b
Showing 1 changed file with 49 additions and 39 deletions.
88 changes: 49 additions & 39 deletions release_management/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ def set_up_subcommand(
func=lambda namespace: RustCrates.tag_rust_library(namespace, subcmd)
)

new_subparser.add_argument(
"--dry-run",
action="store_true",
default=False,
dest="dry_run",
help="Only report actions, do not do them",
)

new_subparser.add_argument(
"--no-publish",
action="store_true",
Expand Down Expand Up @@ -291,14 +283,6 @@ def set_up_subcommand(subcmd, subparsers, *, add_github_release_option=False):
else:
new_subparser.set_defaults(no_github_release=True)

new_subparser.add_argument(
"--dry-run",
action="store_true",
default=False,
dest="dry_run",
help="Only report actions, do not do them",
)

@staticmethod
def tag_python_library(namespace, name):
"""
Expand Down Expand Up @@ -337,29 +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(
"--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 @@ -398,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 @@ -420,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 e77750b

Please sign in to comment.