gpt4 book ai didi

python - 在 requirements.txt 中,波浪号等于 (~=) 是什么意思?

转载 作者:IT老高 更新时间:2023-10-28 21:42:02 32 4
gpt4 key购买 nike

在我正在使用的 Python 库的 requirements.txt 中,其中一个要求被指定为:

mock-django~=0.6.10

~= 是什么意思?

最佳答案

表示会选择最新版本的包,大于等于0.6.10,但还是0.6.*版本,所以不会下载0.7.0等。如果包维护者尊重语义版本控制(即重大更改只应在主要版本中发生),它可确保您获得安全修复但保持向后兼容性。

或者,正如 PEP 440 所说:

For a given release identifier V.N , the compatible release clause is approximately equivalent to the pair of comparison clauses:

>= V.N, == V.*

关于python - 在 requirements.txt 中,波浪号等于 (~=) 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39590187/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com