Skip to content
Pure python implementation of the RPM version comparison algorithm, intended for use in contexts in which the definitive C implementation in RPM is not available.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
rpm_vercmp
.gitignore
LICENSE
MANIFEST.in
README.rst
requirements.txt
setup.cfg
setup.py
test-requirements.txt
tox.ini

README.rst

Pure Python implementation of rpmvercmp.

The RPM Package Manager (http://rpm.org) has a version comparision algorithm, implemented in its C library, which performs the comparison in a certain way.

In certain circumstances, where the C library is not installable (for example, on non-rpm based systems), or does not support the desired version of the python interpreter, the pure-python implementation may be useful.

Source Code

https://github.com/sassoftware/python-rpm-vercmp

Installation

$ pip install rpm_vercmp

Usage

import rpm_vercmp assert rpm_vercmp.vercmp("1.0", "1.0") == 0 assert rpm_vercmp.vercmp("1.0", "1.1") == -1

Testing

The testsuite uses rpm's test file in m4 format. The file cat be fetched from: https://raw.githubusercontent.com/rpm-software-management/rpm/master/tests/rpmvercmp.at

You can’t perform that action at this time.