Skip to content

Commit

Permalink
Handle release tag formats in _parse_tag() (#4548)
Browse files Browse the repository at this point in the history
* Handle release tag formats in _parse_tag()

Also accommodate formal release tags, so the generated version is
correct for downstream packagers.

* Also handle release candidate format in _parse_tag()
  • Loading branch information
dhgutteridge authored Oct 2, 2024
1 parent 79974f2 commit 87b6e26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scapy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def _parse_tag(tag):
# remove the 'v' prefix and add a '.devN' suffix
return '%s.dev%s' % (match.group(1), match.group(2))
else:
raise ValueError('tag has invalid format')
match = re.match('^v?([\\d\\.]+(rc\\d+)?)$', tag)
if match:
# tagged release version
return '%s' % (match.group(1))
else:
raise ValueError('tag has invalid format')


def _version_from_git_archive():
Expand Down

0 comments on commit 87b6e26

Please sign in to comment.