1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-libversion
7 SDESC[py37]= Python bindings for libversion (PY37)
8 SDESC[py38]= Python bindings for libversion (PY38)
9 HOMEPAGE= https://github.com/repology/py-libversion
10 CONTACT= Python_Automaton[python@ironwolf.systems]
13 SITES[main]= PYPI/l/libversion
14 DISTFILE[1]= libversion-1.2.0.tar.gz:main
19 OPTIONS_AVAILABLE= PY38 PY37
20 OPTIONS_STANDARD= none
21 VOPTS[py37]= PY38=OFF PY37=ON
22 VOPTS[py38]= PY38=ON PY37=OFF
26 DISTNAME= libversion-1.2.0
30 [PY37].USES_ON= python:py37
32 [PY38].USES_ON= python:py38
34 [FILE:3643:descriptions/desc.single]
35 # Python bindings for libversion
43 [Github commits (since latest release)]
47 Python bindings for libversion, which provides **fast**, **powerful**
48 and **correct** generic version string comparison algorithm.
50 See [libversion] repository for
51 more details on the algorithm.
55 **libversion** is 10x to 100x faster than other version comparison
56 facilities widely used in Python world.
58 | Facility | comps/sec |
59 |-------------------------------------|----------:|
60 | **libversion.version_compare2** | 3492.81K |
61 | **libversion.version_compare** | 3219.02K |
62 | **libversion.Version** | 374.08K |
63 | tuple(map(int, (v.split('.')))) | 206.02K |
64 | cmp_version.cmp_version | 189.15K |
65 | cmp_version.VersionString | 156.42K |
66 | distutils.version.StrictVersion | 75.00K |
67 | version.Version | 71.39K |
68 | distutils.version.LooseVersion | 51.38K |
69 | pkg_resources.parse_version | 22.26K |
73 **libversion** handles certain complex version cases better than other
74 version comparison facilities. Here are some example cases where others
77 | Test case | libversion | tuple | StrictVersion |
78 LooseVersion | parse_version | cmp_version |
79 |-------------------------|------------|---------------|---------------|---------------|---------------|---------------|
80 | 1.0 == 1.0.0 | ok | incorrect (<) | ok |
81 incorrect (<) | ok | ok |
82 | 1.2_3 == 1.2-3 | ok | fail | fail |
83 incorrect (>) | incorrect (<) | ok |
84 | 1.2.3 == 1.2-3 | ok | fail | fail |
85 fail | incorrect (>) | incorrect (<) |
86 | 1.0alpha1 == 1.0.alpha1 | ok | fail | fail | ok
87 | ok | incorrect (>) |
88 | 1.0rc1 < 1.0 | ok | fail | fail |
89 incorrect (>) | ok | incorrect (>) |
90 | 1.0 < 1.0patch1 | ok | fail | fail | ok
91 | incorrect (>) | ok |
92 | 1.0.2a < 1.0.2g | ok | fail | fail | ok
93 | incorrect (>) | ok |
95 Note 1: **fail** means that attempt to compare versions has thrown
96 an exception, usually bacause a library cannot parse specific version
99 Note 2: **version** module was not able to complete any tests as it's
100 a strict semantic version implementation which require 3 version
101 components. Also, it does not support Python 3 without modification.
103 ## Python wrapper features
105 - Provides API similar to C library, `version_compare(a, b)` function
106 - Provides more pythonic (but slower) `Version` class with overloaded
113 - [libversion] 2.7.0+
118 from libversion import Version, version_compare
120 assert(version_compare("0.9", "1.1") < 0)
121 assert(version_compare("1.0", "1.0.0") == 0)
122 assert(version_compare("1.1", "0.9") > 0)
124 assert(Version("0.9") < Version("1.1"))
125 assert(Version("1.0") == Version("1.0.0"))
126 assert(Version("1.1") > Version("0.9"))
128 assert(Version("0.999") < Version("1.0alpha1"))
129 assert(Version("1.0alpha1") < Version("1.0alpha2"))
130 assert(Version("1.0alpha2") < Version("1.0beta1"))
131 assert(Version("1.0beta1") < Version("1.0pre1"))
132 assert(Version("1.0pre1") < Version("1.0rc1"))
133 assert(Version("1.0rc1") < Version("1.0"))
134 assert(Version("1.0") < Version("1.0patch1"))
138 b352cc98ca4e23095b362e3dee57a75f193b5380060988d4823b84a7a9b47adc 8197 libversion-1.2.0.tar.gz