Generate valid version number with setup.py patch_version

The extra version information must be a valid local version identifier (see https://www.python.org/dev/peps/pep-0440/#local-version-identifiers)
This commit is contained in:
Philipp Wolfer
2019-11-12 15:26:24 +01:00
committed by Philipp Wolfer
parent a65b756480
commit 7fddcc689c
3 changed files with 3 additions and 3 deletions

View File

@@ -626,7 +626,7 @@ class picard_patch_version(Command):
regex = re.compile(r'^PICARD_BUILD_VERSION_STR\s*=.*$', re.MULTILINE)
with open(filename, 'r+b') as f:
source = (f.read()).decode()
build = self.platform + '_' + datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')
build = self.platform + '.' + datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')
patched_source = regex.sub('PICARD_BUILD_VERSION_STR = "%s"' % build, source).encode()
f.seek(0)
f.write(patched_source)