Skip to content

Commit

Permalink
Add more logging around git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperlees committed Oct 24, 2023
1 parent ab245b8 commit 35b4582
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,21 @@
"""


class NoGitTagsError(Exception):
...


# TODO: Do better with alpha + beta releases
# Maybe we vendor packaging library
def get_git_tags(versions_only: bool = True) -> List[str]:
"""Pull out all tags or calvers only"""
git_tags = run(
["git", "tag"], stdout=PIPE, check=True, encoding="utf8"
).stdout.splitlines()
cp = run(
["git", "tag"], stdout=PIPE, stderr=PIPE, check=True, encoding="utf8"
)
if not cp.stdout:
LOG.error(f"Returned no git tags stdout: {cp.stderr}")
raise NoGitTagsError
git_tags = cp.stdout.splitlines()
if versions_only:
return [t for t in git_tags if t[0].isdigit()]
return git_tags
Expand Down

0 comments on commit 35b4582

Please sign in to comment.