简体   繁体   English

requirements.txt代码等于(〜=)vs tilde大于(〜>)

[英]requirements.txt tilde equals (~=) vs tilde greater-than (~>)

According to this question and it's links to elsewhere, I learned that ~= VN is the same as >= VN, == V.* 根据这个问题以及它与其他地方的联系,我了解到~= VN>= VN, == V.*

For a given release identifier VN , the compatible release clause is approximately equivalent to the pair of comparison clauses: 对于给定的发布标识符VN,兼容发布子句大致等同于一对比较子句:

>= VN, == V.*

PEP 440 Compatible Release PEP 440兼容版本

But what does ~> VN mean? 但是什么~> VN是什么意思? Does it just mean > VN, == V.* , indicating that version VN would not satisfy the requirement, but that V.(N+1) would? 它只是意味着> VN, == V.* ,表明版本VN不满足要求,但是V.(N+1)会吗?


Note: I haven't seen anywhere that this notation has been used, but GitHub recently sent a security alert saying to update one requirements.txt to use this syntax. 注意:我没有看到任何地方使用过这种表示法,但GitHub最近发送了一个安全警报,说更新一个requirements.txt以使用这种语法。

This ~> is not a valid requirement specifier in Python. 这个~>不是Python中的有效需求说明符。

The security alert must be talking about another language - perhaps it was a Gemfile (Ruby)? 安全警报一定是在谈论另一种语言 - 也许它是一个Gemfile(Ruby)?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM