python 依赖包的版本描述的格式

参考: https://www.python.org/dev/peps/pep-0440/#id53

The comparison operator determines the kind of version clause:

其中, 逗号 ',' 表示 and 的逻辑关系。

条件运算符以及逗号两侧的空格都是可选的。

Compatible release  ~=

~=V.N 约等于  >= V.N, == V.*

也就是大版本相同,小版本不低于指定的版本号。例如,下面每组版本指定方式中的两种指定方式是等价的。

~= 2.2
>= 2.2, == 2.*

~= 1.4.5
>= 1.4.5, == 1.4.*

Version matching  ==

== 右边的版本号必须符合Pep440规定的Version scheme, 除了结尾可以是 ".*" 。

默认是严格地比较版本是否相等,除了可能在结尾补 0 让两个待比较的版本号的长度一致。

Arbitrary equality ===

这种应该很少使用。完全不考虑版本号的语义和结构,只是简单地比较字符串是否相等。

Arbitrary equality comparisons are simple string equality operations which do not take into account any of the semantic information such as zero padding or local versions. This operator also does not support prefix matching as the == operator does.

posted on 2021-07-12 17:03  等待未知  阅读(228)  评论(0编辑  收藏  举报

导航