# Buildsheet autogenerated by ravenadm tool -- Do not edit.

NAMEBASE=		python-libversion
VERSION=		1.2.4
KEYWORDS=		python
VARIANTS=		v12 v13
SDESC[v12]=		Python bindings for libversion (3.12)
SDESC[v13]=		Python bindings for libversion (3.13)
HOMEPAGE=		https://github.com/repology/py-libversion
CONTACT=		Python_Automaton[python@ironwolf.systems]

DOWNLOAD_GROUPS=	main
SITES[main]=		PYPI/l/libversion
DISTFILE[1]=		libversion-1.2.4.tar.gz:main
DIST_SUBDIR=		python-src
DF_INDEX=		1
SPKGS[v12]=		single
SPKGS[v13]=		single

OPTIONS_AVAILABLE=	PY312 PY313
OPTIONS_STANDARD=	none
VOPTS[v12]=		PY312=ON PY313=OFF
VOPTS[v13]=		PY312=OFF PY313=ON

BUILDRUN_DEPENDS=	libversion:single:std

USES=			pkgconfig

DISTNAME=		libversion-1.2.4

LICENSE=		MIT:single
LICENSE_FILE=		MIT:{{WRKSRC}}/LICENSE
LICENSE_SCHEME=		solo

GENERATED=		yes

[PY312].USES_ON=			python:v12,sutools

[PY313].USES_ON=			python:v13,sutools

[FILE:3633:descriptions/desc.single]
# Python bindings for libversion

	[image]

[CI]
[PyPI downloads]
[PyPI version]
[PyPI pythons]
[Github commits (since latest release)]

## Purpose

Python bindings for libversion, which provides **fast**, **powerful**
and **correct** generic version string comparison algorithm.

See [libversion] repository for
more details on the algorithm.

## Performance

**libversion** is 10x to 100x faster than other version comparison
facilities widely used in Python world.

| Facility                            | comps/sec |
|-------------------------------------|----------:|
| **libversion.version_compare2**     |  3492.81K |
| **libversion.version_compare**      |  3219.02K |
| **libversion.Version**              |   374.08K |
| tuple(map(int, (v.split('.'))))     |   206.02K |
| cmp_version.cmp_version             |   189.15K |
| cmp_version.VersionString           |   156.42K |
| distutils.version.StrictVersion     |    75.00K |
| version.Version                     |    71.39K |
| distutils.version.LooseVersion      |    51.38K |
| pkg_resources.parse_version         |    22.26K |

## Correctness

**libversion** handles certain complex version cases better than other
version comparison facilities. Here are some example cases where others
fail:

| Test case               | libversion | tuple         | StrictVersion |
LooseVersion  | parse_version | cmp_version   |
|-------------------------|------------|---------------|---------------|---------------|---------------|---------------|
| 1.0 == 1.0.0            | ok         | incorrect (<) | ok            |
incorrect (<) | ok            | ok            |
| 1.2_3 == 1.2-3          | ok         | fail          | fail          |
incorrect (>) | incorrect (<) | ok            |
| 1.2.3 == 1.2-3          | ok         | fail          | fail          |
fail          | incorrect (>) | incorrect (<) |
| 1.0alpha1 == 1.0.alpha1 | ok         | fail          | fail          | ok
           | ok            | incorrect (>) |
| 1.0rc1 < 1.0            | ok         | fail          | fail          |
incorrect (>) | ok            | incorrect (>) |
| 1.0 < 1.0patch1         | ok         | fail          | fail          | ok
           | incorrect (>) | ok            |
| 1.0.2a < 1.0.2g         | ok         | fail          | fail          | ok
           | incorrect (>) | ok            |

Note 1: **fail** means that attempt to compare versions has thrown
an exception, usually bacause a library cannot parse specific version
string.

Note 2: **version** module was not able to complete any tests as it's
a strict semantic version implementation which require 3 version
components. Also, it does not support Python 3 without modification.

## Python wrapper features

-  Provides API similar to C library, `version_compare(a, b)` function
-  Provides more pythonic (but slower) `Version` class with overloaded
   comparison operators

## Requirements

-  Python 3.6+
-  pkg-config
-  [libversion] 2.7.0+

## Example code

```python
from libversion import Version, version_compare

assert(version_compare("0.9", "1.1") < 0)
assert(version_compare("1.0", "1.0.0") == 0)
assert(version_compare("1.1", "0.9") > 0)

assert(Version("0.9") < Version("1.1"))
assert(Version("1.0") ==  Version("1.0.0"))
assert(Version("1.1") > Version("0.9"))

assert(Version("0.999") < Version("1.0alpha1"))
assert(Version("1.0alpha1") < Version("1.0alpha2"))
assert(Version("1.0alpha2") < Version("1.0beta1"))
assert(Version("1.0beta1") < Version("1.0pre1"))
assert(Version("1.0pre1") < Version("1.0rc1"))
assert(Version("1.0rc1") < Version("1.0"))
assert(Version("1.0") < Version("1.0patch1"))


[FILE:113:distinfo]
1ce9112917a964cac7443b8a81553091f91051bec0a90635fd9c05afc7c9c087        11562 python-src/libversion-1.2.4.tar.gz