Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Only add maturity/suffix to version if groups matched #1146

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions photon-lib/py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@
# 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:
Expand Down
Loading