LooseVersion¶
- class audeer.LooseVersion(version=None)[source]¶
Version numbering for anarchists and software realists.
This implementation was originally part of
distutils
asversion.LooseVersion
.A version number consists of a series of numbers, separated by either periods or strings of letters. When comparing version numbers, the numeric components will be compared numerically, and the alphabetic components lexically. The following are all valid version numbers, in no particular order:
'1.5.1
,'1.5.2b2
,'161'
,'3.10a'
,'8.02'
,'3.4j'
,'1996.07.12'
,'3.2.pl0'
,'3.1.1.6'
,'2g6'
,'11g'
,'0.960923'
,'2.2beta29'
,'1.13++'
,'5.5.kw'
,'2.0b1pl0'
.- Parameters
version – version string
Examples
>>> v1 = LooseVersion("1.17.2") >>> v1 LooseVersion ('1.17.2') >>> v1.version [1, 17, 2] >>> v2 = LooseVersion("1.17.2-3-g70b71bd") >>> v1 < v2 True