Merge pull request #4523 from shin-/versions_py_fix

Update versions.py script to support new engine versioning schema
This commit is contained in:
Joffrey F 2017-02-21 14:20:54 -08:00 committed by GitHub
commit dbe418924a
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class Version(namedtuple('_Version', 'major minor patch rc')):
version = version.lstrip('v') version = version.lstrip('v')
version, _, rc = version.partition('-') version, _, rc = version.partition('-')
major, minor, patch = version.split('.', 3) major, minor, patch = version.split('.', 3)
return cls(int(major), int(minor), int(patch), rc) return cls(major, minor, patch, rc)
@property @property
def major_minor(self): def major_minor(self):
@ -57,7 +57,7 @@ class Version(namedtuple('_Version', 'major minor patch rc')):
""" """
# rc releases should appear before official releases # rc releases should appear before official releases
rc = (0, self.rc) if self.rc else (1, ) rc = (0, self.rc) if self.rc else (1, )
return (self.major, self.minor, self.patch) + rc return (int(self.major), int(self.minor), int(self.patch)) + rc
def __str__(self): def __str__(self):
rc = '-{}'.format(self.rc) if self.rc else '' rc = '-{}'.format(self.rc) if self.rc else ''