mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-24 01:31:44 +00:00
[python] Only add maturity/suffix to version if groups matched (#1146)
* Only add maturity/suffix if groups matched --------- Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
This commit is contained in:
@@ -16,10 +16,24 @@ m = re.search(
|
||||
# which should be PEP440 compliant
|
||||
if m:
|
||||
versionString = m.group(0)
|
||||
prefix = m.group(1)
|
||||
maturity = m.group(2)
|
||||
suffix = m.group(3).replace(".", "")
|
||||
versionString = f"{prefix}.{maturity}.{suffix}"
|
||||
# Hack -- for strings like v2024.1.1, do NOT add matruity/suffix
|
||||
if len(m.group(2)) > 0:
|
||||
print("using beta group matcher")
|
||||
prefix = m.group(1)
|
||||
maturity = m.group(2)
|
||||
suffix = m.group(3).replace(".", "")
|
||||
versionString = f"{prefix}.{maturity}.{suffix}"
|
||||
else:
|
||||
split = gitDescribeResult.split("-")
|
||||
if len(split) == 3:
|
||||
year, commits, sha = split
|
||||
# Chop off leading v from "v2024.1.2", and use "post" for commits to master since
|
||||
versionString = f"{year[1:]}post{commits}"
|
||||
print("using dev release " + versionString)
|
||||
else:
|
||||
year = gitDescribeResult
|
||||
versionString = year[1:]
|
||||
print("using full release " + versionString)
|
||||
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user