如何安装Python Heroku项目的内部需求? [英] How do I install in-house requirements for Python Heroku projects?

查看:136
本文介绍了如何安装Python Heroku项目的内部需求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有几个内部库,我们已经分离出来(出于多种原因,主要是管理上的,或者有可能在以后轻松地开源)。他们住在私人的Github仓库中,如果这很重要的话。



我想部署一个应用程序到Heroku来试用它。它取决于其中一个库。



我应该在requirements.txt中指定我的依赖关系。这对于PyPI可安装的东西来说很简单,但我该如何处理这些内部依赖?



我可以运行我自己的私人PyPI镜像,或者我可以使用可编辑的软件包(即使文档说他们不应该在生产中使用)。



有什么适当的方法可以做到这一点?

解决方案

GitHub允许在Git仓库进行HTTP基本验证。

所以,你可以添加一个如下所示:

  -e git + https://用户名:密码@ github.com / kennethreitz / requests.git @ v0.10.0#egg =请求

一切都会正常工作:)

We have a few in-house libraries that we've split off (for several reasons, mostly administrative or to have the possibility to easily open source them later). They live in private Github repositories, if that matters.

I'd like to deploy an app to Heroku to try it out. It depends on one of those libraries.

I'm supposed to specify my dependencies in requirements.txt. That's easy for the PyPI-installable stuff, but what do I do for these in-house dependencies?

I could either run my own private PyPI mirror that has this stuff, or I could use editable packages (even though the documentation says they shouldn't be used in production).

What's the appropriate way to do it?

解决方案

GitHub allows HTTP Basic authentication on Git repos.

So, you can add a line like this:

-e git+https://username:password@github.com/kennethreitz/requests.git@v0.10.0#egg=requests

And everything will work properly :)

这篇关于如何安装Python Heroku项目的内部需求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆