Skip to content

Commit

Permalink
Fix version.parse() in do_release.py
Browse files Browse the repository at this point in the history
  • Loading branch information
julianneswinoga committed Nov 17, 2024
1 parent 2991aa4 commit 0a65f24
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/do_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ def main():
if not apply_actions(actions):
clean_exit(0)

is_semver = lambda x: isinstance(version.parse(x), version.Version)
def is_semver(x):
try:
return isinstance(version.parse(x), version.Version)
except version.InvalidVersion:
return False

is_increment = lambda x: version.parse(x) > version.parse(str(git_info['latest_tag']))
poetry_version_rules = ('patch', 'minor', 'major')
check_semver_or_rule = lambda x: (is_semver(x) and is_increment(x)) or x in poetry_version_rules
Expand Down

0 comments on commit 0a65f24

Please sign in to comment.