Add documentation examples for ‘semver.parse’.

This commit is contained in:
Ben Finney 2016-10-18 23:59:54 +11:00
parent 3c0cf9b507
commit 98e83c4361

View File

@ -43,6 +43,11 @@ This module provides just couple of functions, main of which are:
False
>>> semver.format_version(3, 4, 5, 'pre.2', 'build.4')
'3.4.5-pre.2+build.4'
>>> version_parts = semver.parse("3.4.5-pre.2+build.4")
>>> version_parts == {
... 'major': 3, 'minor': 4, 'patch': 5,
... 'prerelease': 'pre.2', 'build': 'build.4'}
True
>>> semver.bump_major("3.4.5")
'4.0.0'
>>> semver.bump_minor("3.4.5")