diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-18 17:41:33 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-24 15:13:09 +0200 |
commit | a5cc0fb509b2c515ae73c85f9a4d426a3f9100e3 (patch) | |
tree | 2beb1ad109f28f995b293a548da4ef76818b7bc3 /README.rst | |
parent | fdef1e9cdae901d095d8e8c9cd6fa6adcfe02074 (diff) | |
download | semantic-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.rst | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 ------------------------- |