Fix marvin package version while building packages (#9230)

This commit is contained in:
Vishesh 2024-06-13 11:29:51 +05:30 committed by GitHub
parent b2ef53b8a2
commit 8221be3a8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,8 @@ def replaceVersion(fname, version):
with open(fname, 'r') as f:
content = f.read()
needle = '\nVERSION\s*=\s*[\'"][^\'"]*[\'"]'
# Ensure the version is PEP440 compliant
version = version.replace('-', '+', 1)
replacement = '\nVERSION = "%s"' % version
content = re.sub(needle, replacement, content, 1)
with open(fname, 'w') as f: