Skip to content

goshdarnharris/py-semver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-semver

A python port of the node.js semver library.

Usage

Run python3 setup.py install. Then:

import semver
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // False
semver.clean('  =v1.2.3   ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // True
semver.gt('1.2.3', '9.8.7') // False
semver.lt('1.2.3', '9.8.7') // True
semver.inc('1.2.3', 'major') // '2.0.0'

py-semver is designed to operate as similarly as possible to isaacs/node-semver.

Versions & Ranges

See the "versions" and "ranges" sections of isaacs/node-semver.

Tests

Run test.py; no output is good output. The tests defined in in tests.py are (nearly) identical to those defined by node-semver.

About

A python port of the node.js semver library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages