Skip to main content

port of node-semver

Project description

https://github.com/podhmo/python-node-semver/actions/workflows/python-package.yml/badge.svg

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

install

pip install node-semver

examples

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.9.0

  • RENAME MODULE semver -> nodesemver (#39)

  • pre release range fix (#40)

0.8.1

  • fix erroneous parsing of $ component version numbers (#44)

0.8.0

  • handle 4-digit version correctly (#35)

0.7.0

  • include tests in source distributions (#31)

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

Uploaded Source

Built Distribution

node_semver-0.9.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: node-semver-0.9.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for node-semver-0.9.0.tar.gz
Algorithm Hash digest
SHA256 04aa0b0016dbc06748d6378c42d8cf82a343415bd9fca6284f488041d08b33bb
MD5 b02700e242fd5cc57b5297b41c535825
BLAKE2b-256 ebc5e823658f716b17ab1c52d68ed13a0e09c0130af052401a26b5738e4290cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: node_semver-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for node_semver-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8153270903772b1e59500ced6f0aca0f7bdb021651c27584e9283b7077b4916b
MD5 66b967ac1c1077600408b62bb996fe35
BLAKE2b-256 1a4b180481021692a76dc91f46fa6a49cdef4c3e630c77a83b7fda3f4eb7aa04

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