Documentation ¶
Overview ¶
Package pep440 implements types for working with versions as defined in PEP-440.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Range ¶
type Range []criterion
Range is a set of criteria corresponding to a range of versions.
func ParseRange ¶
ParseRange takes a version specifer as described in PEP-440 and turns it into a Range, with the following exceptions:
Wildcards are not implemented.
Arbtrary matching (===) is not implemented.
type Version ¶
Version repesents a canonical-ish represention of a PEP440 version.
Local revisions are discarded.
func (*Version) Compare ¶
Compare returns an integer comparing two versions. The result will be 0 if a == b, -1 if a < b and +1 if a > b.
func (*Version) Version ¶
Version returns a fixed-width slice of integers meant for allowing some amount of version comparision with no knowledge of the version scheme.
In generating this slice, the following rules are applied:
Release is normalized to five numbers. Missing numbers are set to "0" and additional numbers are dropped.
The Dev revision is promoted earlier in the int slice if there's no Pre or Post revision, and sorts as earlier than a Pre revision.
Notes ¶
Bugs ¶
The int-slice versioning method tries to accomdate arbitrary numbers, but may give odd results with sufficiently large revision numbers. One suggested workaround is to make fewer than 9 quintillion releases.