Bump versions. Semantically.
Project description
SemVerPy
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')
False
When 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'
Lastly, if you define a partial version, you can be used as a dependency.
>>> version.satisfies(SemVerPy('2.0'))
False
>>> version.satisfies(SemVerPy('2.1'))
True
>>> version.satisfies(SemVerPy('2'))
True
>>> version == SemVerPy('2.1')
False
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
SemVerPy-0.1.0.tar.gz
(2.8 kB
view details)
File details
Details for the file SemVerPy-0.1.0.tar.gz
.
File metadata
- Download URL: SemVerPy-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed7679448fa155ee664d8a2f9fd435c44775d3b9e19b873375b7364a47c336e4 |
|
MD5 | 06622a0917cf81731c79861055607436 |
|
BLAKE2b-256 | 66212f992a5158cb0b4d5db9c65d4ab7db681a704272cf2cac1ec4948c2ee8cd |