Skip to content

Commit 0678061

Browse files
author
Steven Silvester
committed
fix handling of default version bump
1 parent 38f772b commit 0678061

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.github/actions/check-release/action.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,10 @@ runs:
1919
# Set up env variables
2020
export GITHUB_ACCESS_TOKEN=${{ inputs.token }}
2121
export RH_REPOSITORY=${GITHUB_REPOSITORY}
22-
export RH_VERSION_SPEC=0.0.1a0
23-
export RH_POST_VERSION_SPEC=0.1.0.dev0
2422
export RH_CHANGELOG=${{ inputs.changelog }}
2523
export RH_DRY_RUN=true
2624
export RH_REF=${GITHUB_REF}
2725
28-
# check for npm-only package
29-
if [[ ! -f setup.py && -f package.json ]]; then
30-
export RH_VERSION_SPEC=patch
31-
export RH_POST_VERSION_SPEC=
32-
fi
33-
3426
if [ ! -z ${GITHUB_BASE_REF} ]; then
3527
echo "Using GITHUB_BASE_REF: ${GITHUB_BASE_REF}"
3628
export RH_BRANCH=${GITHUB_BASE_REF}

jupyter_releaser/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def main():
114114
click.option(
115115
"--version-spec",
116116
envvar="RH_VERSION_SPEC",
117-
required=True,
117+
default="",
118118
help="The new version specifier",
119119
)
120120
]

jupyter_releaser/util.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from subprocess import PIPE
1818

1919
import toml
20+
from pkg_resources import parse_version
2021

2122
PYPROJECT = Path("pyproject.toml")
2223
SETUP_PY = Path("setup.py")
@@ -176,6 +177,14 @@ def bump_version(version_spec, version_cmd=""):
176177
if not version_cmd: # pragma: no cover
177178
raise ValueError("Please specify a version bump command to run")
178179

180+
# Assign default values if not version spec was given
181+
if not version_spec:
182+
if "tbump" in version_cmd:
183+
version = parse_version(get_version())
184+
version_spec = f"{version.major}.{version.minor}.{version.micro + 1}"
185+
else:
186+
version_spec == "patch"
187+
179188
# Bump the version
180189
run(f"{version_cmd} {version_spec}")
181190

0 commit comments

Comments
 (0)