gpt4 book ai didi

python - 如何在不升级依赖项的情况下更新 Poetry 锁定文件?

转载 作者:行者123 更新时间:2023-12-03 18:34:47 34 4
gpt4 key购买 nike

[tool.poetry.extras] 部分添加到 pyproject.toml 后,Poetry 会显示以下警告,例如在安装时:

Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.



这很好,但是如果我运行 poetry update 它会升级我的依赖项,这不是我目前想要的。如果我改为运行 poetry lock,它仍然会升级依赖项。

很抱歉没有提供可重现的示例,生成具有过时依赖项的诗歌.lock 文件非常棘手。我现有的一个太大了,不能在这里张贴。

更新 :为此问题打开了 sdispater/poetry#1614

最佳答案

从 1.1.2(或更早?)开始,现在有一个选项:

poetry lock --no-update
这使得可以从 pyproject.toml 中删除依赖项并更新锁定文件而无需升级依赖项。
请注意,行为 will be changed in v2.0

关于python - 如何在不升级依赖项的情况下更新 Poetry 锁定文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58961497/

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