37

我使用pipenv(版本 2018.11.26)来管理我的项目中的依赖项。有时我只想添加或更新一个包,而不更改其他包的版本。我怎样才能做到这一点?我都试过了

pipenv update --selective-upgrade requests

pipenv update --keep-outdated requests

但在锁定期间仍然会更新所有软件包的版本。

Pipfile & Pifile.lock: https://gist.github.com/jozo/d8351ed708e84c5ea0f69e82e585e5c6

4

1 回答 1

35

运行pipenv install/uninstall/updatewith--keep-outdated将阻止pipenv更新无关的锁定包。(奇怪的是,这不是默认行为)。

如果您不希望某些软件包自动更新,您应该将它们固定在您的Pipfile.

[packages]
django = "==2.2"
djangorestframework = "==3.9.2"
于 2019-04-12T08:08:14.123 回答