节点semver端口

node-semver的Python项目详细描述


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

python版本的[node semver](https://github.com/isaacs/node-semver

安装

pip install node-semver

示例

# -*- coding:utf-8 -*-fromsemverimportmax_satisfyingversions=['1.2.3','1.2.4','1.2.5','1.2.6','2.0.1']range_='~1.2.3'assertmax_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'assertmax_satisfying(versions,range_,loose=True)=='2.0.0'try:(max_satisfying(versions,range_,loose=False)=='2.0.0')exceptValueErrorase:asserte.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'assertmax_satisfying(versions,range_,loose=False,include_prerelease=True)=='1.2.6-pre.1'assertmax_satisfying(versions,range_,loose=False,include_prerelease=False)=='1.2.5'

0.7.0

在源分布中包含测试(31)

0.6.0

  • 更严格的错误处理(添加了InvalidTypeIncluded)

0.5.1

  • 错误修复

0.5.0

  • 增加了include_prerelease选项

0.4.2

  • 修复支持4位数字的错误(处理预释放和构建)

0.4.0

  • 支持4位版本(例如x.y.z.a)

0.3.0

  • 放下python2.x支架
  • 错误修复,添加排序键功能14

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
TestDjangoPackage  LaueTools  Bugzilla-ETL  improviser  dHydra  behest  djangocms-page-tags  TurboGears2Frozen  atelParser  apache-beam  pycommon  kfw  tox-venv  addresscleaner  prettyprinter  cfunits  ponddy-cookie-agreement  shellgraph  apikeystore  colcon-cmake  crlibm  evtcantools  encrypted-config  cg-predict-price  integer  mETL  gppeval  oolib  potential-spork  mldatalib  coil  geocube  gaphas  hlsorigin  ludwig  agario-bot  pytest-steps  odoo12-addon-purchase-triple-discount  pyrodeo  xtime  django-kickstart  pygit2  gc3pie  aws-ad  Logbook  kangaroo  IntugineHelper  dcmpi  example-pkg-tjskanth  diguilist