An encapsulation of a version for a project, with support for outputting PEP-440 compatible version strings.

This class supports the standard major.minor.micro[rcN] scheme of versioning.

Method __init__ No summary
Method prerelease Undocumented
Method public Return a PEP440-compatible "public" representation of this Version.
Method __repr__ Undocumented
Method __str__ Undocumented
Method __cmp__ Compare two versions, considering major versions, minor versions, micro versions, then release candidates. Package names are case insensitive.
def __init__(self, package, major, minor, micro, release_candidate=None, prerelease=None, dev=None):
ParameterspackageName of the package that this is a version of. (type: str)
majorThe major version number. (type: int or str (for the "NEXT" symbol))
minorThe minor version number. (type: int)
microThe micro version number. (type: int)
release_candidateThe release candidate number. (type: int)
prereleaseThe prerelease number. (Deprecated) (type: int)
devThe development release number. (type: int)
@property
def prerelease(self):
Undocumented
def public(self):

Return a PEP440-compatible "public" representation of this Version.

Examples:

  • 14.4.0
  • 1.2.3rc1
  • 14.2.1rc1dev9
  • 16.04.0dev0
def __repr__(self):
Undocumented
def __str__(self):
Undocumented
def __cmp__(self, other):

Compare two versions, considering major versions, minor versions, micro versions, then release candidates. Package names are case insensitive.

A version with a release candidate is always less than a version without a release candidate. If both versions have release candidates, they will be included in the comparison.

ParametersotherAnother version. (type: Version)
ReturnsNotImplemented when the other object is not a Version, or one of -1, 0, or 1.
RaisesIncomparableVersionswhen the package names of the versions differ.
API Documentation for incremental, generated by pydoctor at 2019-07-16 21:14:27.