Skip to content

Version.py

Version (Version) ¤

This class abstracts handling of a project's versions. It implements the scheme defined in PEP 440. A Version instance is comparison aware and can be compared and sorted using the standard Python interfaces.

This class is descendant from Version found in packaging.version, and implements some additional, "AI"-like normalization during instantiation.

Parameters:

Name Type Description Default
version str

The string representation of a version which will be parsed and normalized before use.

required

Exceptions:

Type Description
InvalidVersion

If the version does not conform to PEP 440 in any way then this exception will be raised.

epoch property readonly ¤

An integer giving the version epoch of this Version instance

release property readonly ¤

A tuple of integers giving the components of the release segment of this Version instance; that is, the 1.2.3 part of the version number, including trailing zeroes but not including the epoch or any prerelease/development/postrelease suffixes