Skip to content

Commit

Permalink
Merge branch 'release/v0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMauderer committed Feb 12, 2025
2 parents 1a1a2c8 + 2777db4 commit ba19466
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,17 @@ def virtualise(ctx: Context, tests: bool = True) -> None:


@task
def tag(ctx: Context) -> None:
def tag(ctx: Context, remote_name: str = "upstream") -> None:
"""
Tag the repository according to defined version using *git-flow*.
Parameters
----------
ctx
Context.
remote_name
Name of the remote repository in the local git repository.
"""

message_box("Tagging...")
Expand Down Expand Up @@ -496,11 +499,12 @@ def tag(ctx: Context) -> None:

version = f"{major_version}.{minor_version}.{change_version}"

result = ctx.run("git ls-remote --tags upstream", hide="both")
result = ctx.run(f"git ls-remote --tags {remote_name}", hide="both")
remote_tags = result.stdout.strip().split("\n") # pyright: ignore
tags = set()
for remote_tag in remote_tags:
tags.add(remote_tag.split("refs/tags/")[1].replace("refs/tags/", "^{}"))
if remote_tag:
tags.add(remote_tag.split("refs/tags/")[1].replace("refs/tags/", "^{}"))
version_tags = sorted(tags)
if f"v{version}" in version_tags:
msg = (
Expand Down

0 comments on commit ba19466

Please sign in to comment.