port of node-semver
Project description
python version of [node-semver](https://github.com/isaacs/node-semver)
# -*- coding:utf-8 -*-
from semver import max_satisfying
versions = ['1.2.3', '1.2.4', '1.2.5', '1.2.6', '2.0.1']
range_ = '~1.2.3'
assert max_satisfying(versions, range_, loose=False) == '1.2.6'
versions = ['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0']
range_ = '~2.0.0'
assert max_satisfying(versions, range_, loose=True) == '2.0.0'
try:
(max_satisfying(versions, range_, loose=False) == '2.0.0')
except ValueError as e:
assert e.args[0] == "Invalid Version: 2.0.0b1"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
node-semver-0.2.0.tar.gz
(10.2 kB
view hashes)
Built Distribution
Close
Hashes for node_semver-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ac641bce52d7d9a5f012687b05bda38f9ec76370667edbdd94abd6cfdd3d36a |
|
MD5 | 7bb6958ed1ffcc68fa6be3bc897c68bb |
|
BLAKE2b-256 | 51ffcef31b5db35ebd626b3b6ddc1c66d80bef6293a8e44165aa50103a0a9e1b |