Return version objects instead of mutating

This commit is contained in:
bom 2023-02-22 10:57:42 +01:00
parent 167eec4620
commit fea5720161

View file

@ -36,10 +36,14 @@ class Version():
return self.version_string
def create_release_version(self):
if self.release_type == ReleaseType.PATCH:
self.is_snapshot = False
else:
self.increment()
release_version = Version(self.version_list, self.release_type)
release_version.is_snapshot = self.is_snapshot
release_version.increment()
return release_version
def create_bump_version(self):
self.increment(ReleaseType.BUMP)
bump_version = Version(self.version_list, self.release_type)
bump_version.is_snapshot = self.is_snapshot
bump_version.release_type = ReleaseType.BUMP
bump_version.increment()
return bump_version