python - 使用 pip install --target 固定 git 修订的版本号
问题描述
我在单独的存储库中有两个 Python 项目,例如:common
和depends_on_common
.
由于我们部署环境的限制(我没有ssh访问权限),我希望使用
pip install --no-deps --target common /path/to/common
作为供应商的 CI/CD 构建阶段的common
一部分depends_on_common
。我想做的是指定一个显式版本的 common 或一个 git 修订版,而不是有效地始终构建快照。
文档中没有提到此功能:
-t, --target <dir>
Install packages into <dir>. By default this will not replace existing files/folders in <dir>. Use --upgrade to replace existing packages in <dir> with new versions.
但我希望有一些聪明的方法来实现这一点。
解决方案
也许这部分pip install
文档可以为您指明正确的方向。
你可能想要这样的东西:
pip install --no-deps --target ./common git+file:///path/to/common@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=common
推荐阅读
- ios - SwiftUI:导航栏显示第一个列表项的标题,否则显示“返回”
- ansible - 如何对列表进行循环并使用“何时”条件
- .net-core - 在也使用 netstandard2.1 的项目中升级到 .NET Core 3 并未在 Rider 中构建
- excel - 用于 Power Query 的 Excel 保护数据源
- php - htaccess 以子域作为变量重写
- redirect - Traefik 合并斜线
- python - Django 看不到西里尔文文件夹名称和文件
- jenkins - Jenkinsfile 不会替换变量
- linux - 如果没有像我期望的那样处理 Bash 脚本
- vue.js - VueJs 3 + Vuetify:不能在 IE 和 Edge 中工作