GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - Rust-Python-Packaging/pyver: Python PEP-440 Version Parsing

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.rustfmt.toml
.rustfmt.toml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
deny.toml
deny.toml
 
 

Repository files navigation

PyVer

Crates.io Crates.io docs.rs ๐Ÿงช Tests ๐Ÿ–‹  Check linting ๐Ÿ”จ Build ๐Ÿ“ฆ Package ๐Ÿ“„ Build docs ๐Ÿ‘” Check formatting

Python PEP-440 Version Parser

This package allows for parsing Python PEP-440 version numbers and for comparisons between PEP-440 version numbers.

Usage

[dependencies]
pyver = "1"

The following is an example for initilizing and comparing two version strings

use pyver::PackageVersion;

let a = PackageVersion::new("v1.0a2.dev456").unwrap();
let b = PackageVersion::new("v1.0a2.dev457").unwrap();

assert_eq!(a < b, true);

Comparing single version components

use pyver::PackageVersion;

let a = PackageVersion::new("1!1.323.dev2").unwrap();
let b = PackageVersion::new("v3.2.dev2").unwrap();

// Check that both have the same dev version
assert_eq!(a.dev, b.dev);

Seperation of version identifiers

use pyver::PackageVersion;

let version = PackageVersion::new("v1.23.dev2").unwrap();

println!("{:?}", version.release.major);
// > 1

println!("{:?}", version.release.minor);
// > 2

println!("{:?}", version.dev);
// > Some(DevHead { dev_num: Some(2) })

See more examples at the docs

Contribution

For now Contributions will be quite loose.

About

Python PEP-440 Version Parsing

crates.io/crates/pyver

Topics

parsingpythonpython-packagepython-packagespython-version-managementversioning

Resources

Readme
MIT license
Activity
Custom properties

Stars

2 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.