pyversion

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pyversion parses and orders versions the way packaging.version.Version does

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(a, b *Version) int

Sign of a minus b in the packaging _cmpkey order

Types

type InvalidVersion

type InvalidVersion struct{ Text string }

InvalidVersion packaging raises for text outside the PEP 440 grammar

func (*InvalidVersion) Error

func (e *InvalidVersion) Error() string

type Version

type Version struct {
	Epoch   *big.Int
	Release []*big.Int
	PreL    string
	PreN    *big.Int
	Post    *big.Int
	Dev     *big.Int
	Local   []string
}

Parsed PEP 440 version with the packaging normalisation applied

func Parse

func Parse(text string) (*Version, error)

Parses text like packaging.version.Version, an InvalidVersion for text outside the grammar

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL