【问题标题】:Use private repository for Python in Google App Engine在 Google App Engine 中使用 Python 的私有存储库
【发布时间】:2018-12-17 05:57:25
【问题描述】:

我想使用我自己位于私有存储库中的包。

实际上,我使用 requirements.txt 文件在我的 Python AppEngine 中安装依赖项。

但是,我不明白我必须在哪里添加我的私有依赖项。

谢谢

【问题讨论】:

  • 标准环境还是灵活环境?
  • 您是否尝试在需求中添加extra-index-url?例如。 pypkg==1.0 --extra-index-url=https://my.pypi.org.
  • 使用 Python 3 的灵活环境
  • 谢谢胡夫林。我可以试试。但是我如何使用授权密钥?
  • 您是否要求在您的 Google App Engine 应用中使用第三方库?如果是这样,在GAE 中是可能的。在this 回答中解释了如何做的步骤。这是您想要管理的吗?

标签: python google-app-engine pip


【解决方案1】:

您必须使用git+ssh 协议将私有包添加到requirements.txt。可以在这里找到更好的说明:Is it possible to use pip to install a package from a private github repository?

但是,我不确定 GAE 如何处理访问包所需的私钥。如果GAE在部署时只从AppEngine项目仓库复制lib目录,没有其他神奇的操作,它应该可以工作。如果 AppEngine 仅使用 lib 依赖项来收集包的名称,然后自己做一些有趣的事情,我猜你会很不走运,如果不存在向 AppEngine 提供凭据以进行部署的方法。

我现在无法对此进行测试,但会尽快更新。

【讨论】:

    猜你喜欢
    • 2020-01-29
    • 1970-01-01
    • 1970-01-01
    • 2012-04-03
    • 1970-01-01
    • 2014-08-28
    • 2012-06-14
    • 2010-12-30
    • 1970-01-01
    相关资源
    最近更新 更多