Pipenv 生成 requirements.txt

之前常用这行命令生成 requirements 文件:

pipenv lock -r > requirements.txt && pipenv lock --dev-only -r > requirements-dev.txt

现在发现,pipenv 开始 deprecated 这个 -r 参数了。

Warning: The lock flag -r/--requirements will be deprecated in a future version
of pipenv in favor of the new requirements command. For more info see
NOTE: the requirements command parses Pipfile.lock directly without performing any
locking operations. Updating packages should be done by running pipenv lock.


pipenv requirements > requirements.txt && pipenv requirements --dev-only > requirements-dev.txt

不用 lock,效率更好。