Skip to content

Commit e17735c

Browse files
author
Steven Silvester
authored
Merge pull request #145 from blink1073/allow-fail-prep-git
Make tag name configurable
2 parents fc1ad71 + f708f4d commit e17735c

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

jupyter_releaser/cli.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def check_python(dist_dir):
345345
def build_npm(package, dist_dir):
346346
"""Build npm package"""
347347
if not osp.exists("./package.json"):
348-
util.log("Skipping check-npm since there is no package.json file")
348+
util.log("Skipping build-npm since there is no package.json file")
349349
return
350350
npm.build_dist(package, dist_dir)
351351

@@ -410,6 +410,12 @@ def check_links(ignore_glob, ignore_links, cache_file, links_expire):
410410
default="Publish {version}",
411411
help="The message to use for the release commit",
412412
)
413+
@click.option(
414+
"--tag-format",
415+
envvar="RH_TAG_FORMAT",
416+
default="v{version}",
417+
help="The format to use for the release tag",
418+
)
413419
@click.option(
414420
"--tag-message",
415421
envvar="RH_TAG_MESSAGE",
@@ -422,9 +428,13 @@ def check_links(ignore_glob, ignore_links, cache_file, links_expire):
422428
help="Whether to skip tagging npm workspace packages",
423429
)
424430
@use_checkout_dir()
425-
def tag_release(dist_dir, release_message, tag_message, no_git_tag_workspace):
431+
def tag_release(
432+
dist_dir, release_message, tag_format, tag_message, no_git_tag_workspace
433+
):
426434
"""Create release commit and tag"""
427-
lib.tag_release(dist_dir, release_message, tag_message, no_git_tag_workspace)
435+
lib.tag_release(
436+
dist_dir, release_message, tag_format, tag_message, no_git_tag_workspace
437+
)
428438

429439

430440
@main.command()

jupyter_releaser/lib.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ def make_changelog_pr(auth, branch, repo, title, commit_message, body, dry_run=F
173173
util.actions_output("pr_url", pull.html_url)
174174

175175

176-
def tag_release(dist_dir, release_message, tag_message, no_git_tag_workspace):
176+
def tag_release(
177+
dist_dir, release_message, tag_format, tag_message, no_git_tag_workspace
178+
):
177179
"""Create release commit and tag"""
178180
# Get the new version
179181
version = util.get_version()
@@ -182,8 +184,8 @@ def tag_release(dist_dir, release_message, tag_message, no_git_tag_workspace):
182184
util.create_release_commit(version, release_message, dist_dir)
183185

184186
# Create the annotated release tag
185-
tag_name = f"v{version}"
186-
tag_message = tag_message.format(tag_name=tag_name)
187+
tag_name = tag_format.format(version=version)
188+
tag_message = tag_message.format(tag_name=tag_name, version=version)
187189
util.run(f'git tag {tag_name} -a -m "{tag_message}"')
188190

189191
# Create release tags for workspace packages if given

jupyter_releaser/tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def test_list_envvars(runner):
166166
repo: RH_REPOSITORY
167167
resolve-backports: RH_RESOLVE_BACKPORTS
168168
since: RH_SINCE
169+
tag-format: RH_TAG_FORMAT
169170
tag-message: RH_TAG_MESSAGE
170171
twine-cmd: TWINE_COMMAND
171172
username: GITHUB_ACTOR

0 commit comments

Comments
 (0)