如何使用 pipfile 在自定义 git 分支的 pipfile 包中指定?

How to specify in the pipfile package from custom git branch using pipfile?

可以在来自自定义 Git 存储库的 Pipfile 包中指定。 但是我找不到关于如何指定具体分支或用于安装的提交的综合文档。

是否有关于如何使用 Pipfile 中的 python 包的 Git URL 的完整参考,pipenv 支持这些 URL 来指定自定义分支、版本或提交?

如果能有等效的 pipenv 命令行参数就好了。

这里有一些关于 GitHub pipenv 存储库的文档:

You can install packages with pipenv from git and other version control systems using URLs formatted according to the following rule:

<vcs_type>+<scheme>://<location>/<user_or_organization>/<repository>@<branch_or_tag>#egg=<package_name>

https://github.com/pypa/pipenv/blob/master/docs/basics.rst#-a-note-about-vcs-dependencies

所以,例如:

[packages]
requests = {git = "https://github.com/requests/requests.git", editable = true, ref = "v2.20.1"}

您可以使用命令行生成 Pipfile。上面的 Pipfile 是通过以下方式生成的:

pipenv install -e git+https://github.com/requests/requests.git@v2.20.1#egg=requests

pip 的文档更详细 here