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"

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

Uploaded Source

Built Distribution

node_semver-0.4.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: node-semver-0.4.0.tar.gz
  • Upload date:
  • Size: 10.6 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.0

File hashes

Hashes for node-semver-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8bd1f46b174a0aee61ebee9c19095e9e2e09203f2b62dfd3e4bd22a9363c8d4a
MD5 2f7d8e97b50621d0d66c3b1186fd8bc7
BLAKE2b-256 c5edbaa6b48bd1b4bbf81a74092b5a603d6a93bc71902027ef604fccd7bfa56c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: node_semver-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 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.0

File hashes

Hashes for node_semver-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc6ad717e70157fa891e6906c20b7626b3cb2a19a76a577840657fb87e4eaa3
MD5 9aa80821db15c74b2748e90f56cee708
BLAKE2b-256 28128c68fc6d617bbb30fe4aa69a336de36346aa38d5baa3f6be51ad5aff6979

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