[][src]Crate verlib

Version manipulation library.

This library provides a way to parse version identifier, and convert them between multiple standards such as semver.org's Semantic Versioning, Python's PEP-440, etc.

Why not stick with semantic versioning?

Semantic versioning has the benefit of being a standard, and is (sort-of) used by some ecosystems, but has many short-comings. For example, it does not support post-releases. It also has some (minor?) incompatibilities with some (most?) standards already in use before its inception, such as Git (output of git describe), Debian, Fedora, Python, Conda, etc. A lot of important features were disregarded in the creation of semver (such as post-releases or third-party packaging), and some incompatible choices were made (having the dash automatically indicate a pre-release).

Fortunately most of the other versioning schemes are still used when appropriate.

This library intends to support most of the version numbers actually in the wild and to provide conversion utilities where possible.

Functionality

This library is based around Debian's versioning scheme, which is both very expressive (used by the Debian and Ubuntu communities to version millions of packages of all kinds of software), very compatible (accepts any version string under the sun), and proved (Debian has been around for a while).

It can also represent and "import" version numbers from foreign schemes, such semver, PEP-440, etc.

If you want to parse random version numbers that you can't assume follow semver, this library is probably what you want.

Modules

debian

Implement Debian's versioning scheme.

python

Implement Python's versioning scheme.

semver

Implements semver.org's so-called Semantic Versioning scheme.

Structs

SimpleVersion

A simple "old-school" version number (only numbers and dots).

Version

A version number.

Enums

InvalidVersion

Error for the version parser.