gpt4 book ai didi

python - 对于 python 的 pip,requirements.txt 中 ruby​​ 的 gem 中的 twiddle-wakka (~>) 等效于什么?

转载 作者:太空狗 更新时间:2023-10-30 02:21:15 26 4
gpt4 key购买 nike

我见过在 ruby​​ 的 gem 文件 (documentation) 中使用的 twiddle-wakka 运算符 (~>) 来指定兼容的最后一 pip 版本,如下所示:

'~> 0.3.1' is satisfied by 0.3.1, 0.3.2, 0.3.3, etc.
'~> 0.3.1' is not satisfied by 0.3.0
'~> 0.3' is satisfied by 0.3.1, 0.4.0, 0.5.1, etc.
'~> 0.3' is not satisfied by 0.2.0, 0.2.1, etc.

我看到 requirements.txt 中有一个 >= 运算符可用于指定比这更好的任何内容,但我希望避免任何 future 包更新(主要版本更新)已经不向后兼容我的代码——因此我想要一个 twiddle-wakka。

pip 中是否有等效的运算符?

最佳答案

总有一天它会是~= compatible-release operator specified by PEP 440 ,但目前还没有任何常见的 Python 工具支持它——pip 也不支持,新的 setuptools unfork 也不支持。 .

现在您必须手动指定它,例如,

Django >= 1.4.3, < 1.5

关于python - 对于 python 的 pip,requirements.txt 中 ruby​​ 的 gem 中的 twiddle-wakka (~>) 等效于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17281998/

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