summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2019-08-18 17:41:33 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2019-08-24 15:13:09 +0200
commita5cc0fb509b2c515ae73c85f9a4d426a3f9100e3 (patch)
tree2beb1ad109f28f995b293a548da4ef76818b7bc3 /README.rst
parentfdef1e9cdae901d095d8e8c9cd6fa6adcfe02074 (diff)
downloadsemantic-version-a5cc0fb509b2c515ae73c85f9a4d426a3f9100e3.tar.gz
Allow Version(major=1, ...).
Eases the creation of version objects from existing versions. We still validate the type and structure of each component.
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 682a8c7..ac42f72 100644
--- a/README.rst
+++ b/README.rst
@@ -149,6 +149,22 @@ It is also possible to check whether a given string is a proper semantic version
False
+Finally, one may create a :class:`Version` with named components instead:
+
+.. code-block:: pycon
+
+ >>> semantic_version.Version(major=0, minor=1, patch=2)
+ Version('0.1.2')
+
+In that case, ``major``, ``minor`` and ``patch`` are mandatory, and must be integers.
+``prerelease`` and ``patch``, if provided, must be tuples of strings:
+
+.. code-block:: pycon
+
+ >>> semantic_version.Version(major=0, minor=1, patch=2, prerelease=('alpha', '2'))
+ Version('0.1.2-alpha.2')
+
+
Requirement specification
-------------------------