以下命令从 git 存储库安装 Python 包:
$ pip install git+ssh://git@github.com/username/repo.git
Collecting git+ssh://git@github.com/username/repo.git
Cloning ssh://git@github.com/username/repo.git to /tmp/pip-req-build-8s4nci15
Run Code Online (Sandbox Code Playgroud)
我不是 100% 确定,但由于它需要很长时间,我猜它会克隆每个提交。但是对于安装,我只需要最新的。
相反,我想要一个浅克隆(带有--depth 1)。那可能吗?
添加--depth 1到git clone命令已经被详细讨论过,暂时被pip的维护者拒绝。这似乎是一个比人们想象的更复杂的问题,特别是因为它会破坏setuptools_scm广泛使用的问题。
正如克劳斯在评论中所说,您可以git clone通过指向远程存档文件来避免开销而不是使用 Git URL:
Run Code Online (Sandbox Code Playgroud)pip install http://my.package.repo/SomePackage-1.0.4.zip
| 归档时间: |
|
| 查看次数: |
1184 次 |
| 最近记录: |