From cf45f6137ea149a5c9e6f3ad3303a14e6316baac Mon Sep 17 00:00:00 2001 From: Duc Trung LE Date: Fri, 15 Oct 2021 09:18:57 +0200 Subject: [PATCH] Backport PR #1002: Add next to the bump script --- scripts/bump-version.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/bump-version.py b/scripts/bump-version.py index 551d01b89..bf06dcec8 100644 --- a/scripts/bump-version.py +++ b/scripts/bump-version.py @@ -9,7 +9,7 @@ from jupyter_releaser.util import is_prerelease, get_version, run -OPTIONS = ["major", "minor", "release", "build"] +OPTIONS = ["major", "minor", "release", "build", "patch", "next"] def patch(force=False): @@ -36,10 +36,6 @@ def patch(force=False): def update(spec, force=False): prev = get_version() - # Make sure we have a valid version spec. - if spec not in OPTIONS: - raise Exception(f"Version spec must be one of: {OPTIONS}") - is_final = not is_prerelease(prev) if is_final and spec == "release": @@ -94,6 +90,10 @@ def bump(force, spec): if len(status) > 0: raise Exception("Must be in a clean git state with no untracked files") + # Make sure we have a valid version spec. + if spec not in OPTIONS: + raise ValueError(f"Version spec must be one of: {OPTIONS}") + prev = get_version() is_final = not is_prerelease(prev) if spec == "next":