summaryrefslogtreecommitdiff
path: root/README.rst
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 /README.rst
parent5525528da2e00579777f5c2ce392a629b2634ff2 (diff)
downloadsemantic-version-0b4d4c724f6d86bbc2c964af0463ef28de7c8015.tar.gz
Adds a new bump version func to the API.
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index a13871c..a6bf947 100644
--- a/README.rst
+++ b/README.rst
@@ -107,6 +107,22 @@ Obviously, :class:`Versions <Version>` can be compared:
>>> semantic_version.Version('0.1.1') <= semantic_version.Version('0.1.1-alpha')
False
+You can also get a new version that represents a bump in one of the version levels:
+
+.. code-block:: pycon
+
+ >>> v = semantic_version.Version('0.1.1-pre+build')
+ >>> new_v = v.next_major()
+ >>> str(new_v)
+ '1.0.0'
+ >>> v = semantic_version.Version('1.1.1-pre+build')
+ >>> new_v = v.next_minor()
+ >>> str(new_v)
+ '1.2.0'
+ >>> v = semantic_version.Version('1.1.1-pre+build')
+ >>> new_v = v.next_patch()
+ >>> str(new_v)
+ '1.1.2'
It is also possible to check whether a given string is a proper semantic version string: