Skip to main content

port of node-semver

Project description

https://travis-ci.org/podhmo/python-semver.svg?branch=master

python version of [node-semver](https://github.com/isaacs/node-semver)

install

pip install node-semver

examples

# -*- 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"

versions = ['1.2.3', '1.2.4', '1.2.5', '1.2.6-pre.1', '2.0.1']
range_ = '~1.2.3'
assert max_satisfying(versions, range_, loose=False, include_prerelease=True) == '1.2.6-pre.1'
assert max_satisfying(versions, range_, loose=False, include_prerelease=False) == '1.2.5'

0.6.0

  • more strict error handling (InvalidTypeIncluded is added)

0.5.1

  • bug fix

0.5.0

  • include_prerelease option is added

0.4.2

  • fix bug for support 4-digit (handling prelease and build)

0.4.0

  • suport 4-digit version (e.g. x.y.z.a)

0.3.0

  • drop python2.x support

  • bug fix, Add sort key function #14

Project details


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.6.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

node_semver-0.6.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file node-semver-0.6.0.tar.gz.

File metadata

  • Download URL: node-semver-0.6.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.1

File hashes

Hashes for node-semver-0.6.0.tar.gz
Algorithm Hash digest
SHA256 effcbc7e0b12539596cb42ad79deccfab211f6d3542d28240359c30d03b4685d
MD5 e4b4f08b34ad4bf9ca4629696d77d64a
BLAKE2b-256 b82cb7baeed3204c966c4e8b5b8fc7b12fc44275b0f2ca491099738478f003f1

See more details on using hashes here.

File details

Details for the file node_semver-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: node_semver-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.1

File hashes

Hashes for node_semver-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ba3d97e2db9300fc7a674e1a5871fccb3f74c373c6cf109fac2c5dca52d167c
MD5 c47fdd4fcbf1d6fc1c633444deadc5a4
BLAKE2b-256 5868f6d8bff52fb9fc6e2edf419a4cdc6c396f3da62db8a3c889f55d12bb9a1e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page