class documentation

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 __cmp__ Compare two versions, considering major versions, minor versions, micro versions, then release candidates, then postreleases, then dev releases. Package names are case insensitive.
Method __eq__ Undocumented
Method __ge__ Undocumented
Method __gt__ Undocumented
Method __init__ No summary
Method __le__ Undocumented
Method __lt__ Undocumented
Method __ne__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method public Return a PEP440-compatible "public" representation of this Version.
Instance Variable dev Undocumented
Instance Variable major Undocumented
Instance Variable micro Undocumented
Instance Variable minor Undocumented
Instance Variable package Undocumented
Instance Variable post Undocumented
Instance Variable release_candidate Undocumented
Property prerelease Undocumented
def __cmp__(self, other: object) -> int:

Compare two versions, considering major versions, minor versions, micro versions, then release candidates, then postreleases, then dev releases. 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.

Likewise, a version with a dev release is always less than a version without a dev release. If both versions have dev releases, they will be included in the comparison.

Parameters
other:VersionAnother version.
Returns
intNotImplemented when the other object is not a Version, or one of -1, 0, or 1.
Raises
IncomparableVersionswhen the package names of the versions differ.
def __eq__(self, other: object) -> bool:

Undocumented

def __ge__(self, other: object) -> bool:

Undocumented

def __gt__(self, other: object) -> bool:

Undocumented

def __init__(self, package: str, major: Literal['NEXT'] | int, minor: int, micro: int, release_candidate: int | None = None, prerelease: int | None = None, post: int | None = None, dev: int | None = None):
Parameters
package:strName of the package that this is a version of.
major:int or str (for the "NEXT" symbol)The major version number.
minor:intThe minor version number.
micro:intThe micro version number.
release_candidate:intThe release candidate number.
prerelease:intThe prerelease number. (Deprecated)
post:intThe postrelease number.
dev:intThe development release number.
def __le__(self, other: object) -> bool:

Undocumented

def __lt__(self, other: object) -> bool:

Undocumented

def __ne__(self, other: object) -> bool:

Undocumented

def __repr__(self) -> str:

Undocumented

def __str__(self) -> str:

Undocumented

def public(self) -> str:

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

Examples:

  • 14.4.0
  • 1.2.3rc1
  • 14.2.1rc1dev9
  • 16.04.0dev0
dev =

Undocumented

major =

Undocumented

micro =

Undocumented

minor =

Undocumented

package =

Undocumented

post =

Undocumented

release_candidate =

Undocumented

@property
prerelease: int | None =

Undocumented