diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-06-15 16:07:56 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-06-16 06:57:01 +0200 |
commit | ef809ddc256a944f34289ef27be47655fdfa98a5 (patch) | |
tree | 3da3cb4f602b533cdb7bc5e495100425cf2691af | |
parent | d05ed2e47a0b48c08b8bc7611d0d7c96125635a8 (diff) | |
download | astroid-git-ef809ddc256a944f34289ef27be47655fdfa98a5.tar.gz |
Small change to the script for simplification
-rw-r--r-- | script/bump_changelog.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/script/bump_changelog.py b/script/bump_changelog.py index 9b4b797c..21deb498 100644 --- a/script/bump_changelog.py +++ b/script/bump_changelog.py @@ -21,15 +21,13 @@ NEW_RELEASE_DATE_MESSAGE = "Release Date: {}".format(TODAY.strftime("%Y-%m-%d")) def main() -> None: - args = parse_args() - if "dev" not in args.version: - run(args.version) - - -def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(add_help=__doc__) parser.add_argument("version", help="The version we want to release") - return parser.parse_args() + args = parser.parse_args() + if "dev" not in args.version: + version = args.version + next_version = get_next_version(version) + run(version, next_version) def get_next_version(version: str) -> str: @@ -38,10 +36,9 @@ def get_next_version(version: str) -> str: return ".".join(new_version) -def run(version: str) -> None: +def run(version: str, next_version: str) -> None: with open(DEFAULT_CHANGELOG_PATH) as f: content = f.read() - next_version = get_next_version(version) content = transform_content(content, version, next_version) with open(DEFAULT_CHANGELOG_PATH, "w") as f: f.write(content) |