Search code examples
pythonvirtualenvsetuptools

Create Python .egg that installs from git repository


I'm currently researching deployment techniques for our Python products. We manage our code with multiple git repositories already but want to improve the process of setting up and updating our servers. It seems that easy_install, .egg files and virtualenv are the best tools for doing this nowadays.

Here's the catch: We don't really do versioning; all our products have a master branch which is supposed to provide stable code all the time. If we want to update, we have to git pull the master branch on every server, for each product and all its dependencies.

This solution is very time-consuming and we want to improve it.

My idea was to create a virtualenv instance on all servers/installations and use easy_install to install and update our own packages, but I couldn't find a way to specify a git repository as a source for the source code.

Is there a way to achieve that? Did I miss something? Am I going in the wrong direction and this is a bad idea overall?

Thanks in advance, Fabian


Solution

  • You can use pip instead of easy_install, it supports a number of possible ways to specify where to get the package from, one being git, you could then install your package like this:

    pip install git://my.git-repo.com/my_project.git