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 |
Undocumented |
Property | prerelease |
Undocumented |
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:Version | Another version. |
Returns | |
int | NotImplemented when the other object is not a Version, or one of -1, 0, or 1. |
Raises | |
IncomparableVersions | when the package names of the versions differ. |
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:str | Name of the package that this is a version of. |
major:int or str (for the "NEXT" symbol) | The major version number. |
minor:int | The minor version number. |
micro:int | The micro version number. |
release | The release candidate number. |
prerelease:int | The prerelease number. (Deprecated) |
post:int | The postrelease number. |
dev:int | The development release number. |
Return a PEP440-compatible "public" representation of this Version
.
Examples:
- 14.4.0
- 1.2.3rc1
- 14.2.1rc1dev9
- 16.04.0dev0