Skip to content

Commit

Permalink
Use legacy versioning for client versions before 0.18.0
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Kotrasinski <[email protected]>
  • Loading branch information
Wesmania committed Jun 17, 2018
1 parent 5a0f95f commit 7caefb2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/updater/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ class ReleaseType(Enum):

@classmethod
def get(cls, version):
if version < Version("0.18.0"):
return cls.legacy_versioning(version)
else:
return cls.new_versioning(version)

@classmethod
def legacy_versioning(cls, version):
if version.minor % 2 == 1:
return cls.UNSTABLE
else:
if version.prerelease == ():
return cls.STABLE
else:
return cls.PRERELEASE

@classmethod
def new_versioning(cls, version):
if any(p in version.prerelease for p in ['alpha', 'beta']):
return cls.UNSTABLE
if any(p in version.prerelease for p in ['pre', 'rc']):
Expand Down

0 comments on commit 7caefb2

Please sign in to comment.