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?
You can write, say, "-e git+ssh://git@.../PIL#egg=PIL" instead of "PIL" in your requirements.txt file and it'll fetch it from there.
However, this would require you to somehow specify the ssh private key to be used by heroku when pulling.
GitHub allows HTTP Basic authentication on Git repos.
So, you can add a line like this:
And everything will work properly :)
There is a buildpack for just this: https://elements.heroku.com/buildpacks/debitoor/ssh-private-key-buildpack
Do this:
Now add given ssh key to github and you can use those "git+git@github.com" dependencies when deploying to Heroku.
In
requirements.txt
you can mention like the following.git+git://github.com/kracekumar/blaze.git
Meanwhile you can clone the library and create virtual environment and install inside the env. Heroku dev center has articles including virtual env set up.