Bumping versions. Semantically.
Usage is pretty simple:
>>> from semverpy import SemVerPy
>>> version = SemVerPy('1.0.0')
>>> version.bump_minor()
<SemVerPy(1.1.0)>
>>> str(version)
'1.1.0'It also supports comparisons:
>>> version == SemVerPy('1.1.0')
True
>>> version > SemVerPy('1.0.0')
True
>>> version > SemVerPy('2.0.0')
FalseWhen you bump a version, all the smaller version numbers are set to zeroes.
>>> version.bump_major()
<SemVerPy(2.0.0)>
>>> str(version)
'2.0.0'You can also define a build number when bumping a version:
>>> version.bump_minor('buildinfo')
<SemVerPy(2.1.0-buildinfo)>
>>> str(version)
'2.1.0-buildinfo'If you define a partial version, SemVerPy will fill the blanks with 0's as a shorthand for quick versions:
>>> quick_version = SemVerPy('1')
<SemVerPy(1.0.0)>Of course, this is perhaps not always the intended behaviour, so you can also specify a dependency:
>>> version.satisfies(SemVerPy('2.0', dependency=True))
False
>>> version.satisfies(SemVerPy('2.1', dependency=True))
True
>>> version.satisfies(SemVerPy('2', dependency=True))
True
>>> version == SemVerPy('2.1', dependency=True)
False