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 return self.version_string
def create_release_version(self): def create_release_version(self):
if self.release_type == ReleaseType.PATCH: release_version = Version(self.version_list, self.release_type)
self.is_snapshot = False release_version.is_snapshot = self.is_snapshot
else: release_version.increment()
self.increment() return release_version
def create_bump_version(self): 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