summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-06-15 16:07:56 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-06-16 06:57:01 +0200
commitef809ddc256a944f34289ef27be47655fdfa98a5 (patch)
tree3da3cb4f602b533cdb7bc5e495100425cf2691af
parentd05ed2e47a0b48c08b8bc7611d0d7c96125635a8 (diff)
downloadastroid-git-ef809ddc256a944f34289ef27be47655fdfa98a5.tar.gz
Small change to the script for simplification
-rw-r--r--script/bump_changelog.py15
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)