summaryrefslogtreecommitdiff
path: root/semantic_version
diff options
context:
space:
mode:
authorRick Eyre <rick.eyre@hotmail.com>2015-02-17 11:50:30 -0500
committerRaphaƫl Barrois <raphael.barrois@polytechnique.org>2015-04-01 01:20:27 +0200
commit0b4d4c724f6d86bbc2c964af0463ef28de7c8015 (patch)
tree013d9ddc0f29dd9dda0fe8dad9830109ca4b58e6 /semantic_version
parent5525528da2e00579777f5c2ce392a629b2634ff2 (diff)
downloadsemantic-version-0b4d4c724f6d86bbc2c964af0463ef28de7c8015.tar.gz
Adds a new bump version func to the API.
Diffstat (limited to 'semantic_version')
-rw-r--r--semantic_version/base.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/semantic_version/base.py b/semantic_version/base.py
index b56fcee..841c5f3 100644
--- a/semantic_version/base.py
+++ b/semantic_version/base.py
@@ -88,6 +88,17 @@ class Version(object):
return value
return int(value)
+ def next_major(self):
+ return Version('.'.join(str(x) for x in [self.major + 1, 0, 0]))
+
+ def next_minor(self):
+ return Version(
+ '.'.join(str(x) for x in [self.major, self.minor + 1, 0]))
+
+ def next_patch(self):
+ return Version(
+ '.'.join(str(x) for x in [self.major, self.minor, self.patch + 1]))
+
@classmethod
def coerce(cls, version_string, partial=False):
"""Coerce an arbitrary version string into a semver-compatible one.