I’m setting this up for my own python development, and so far it’s working LIKE A BOSS. Using my workstation as a development environment, and a server as the production environment, I’m synergizing the deliverables by maximizing throughput in the signal/noise ratio.

Erm.

That is, I’m using virtualenv (and a set of popular virtualenv wrapper scripts) along with git to keep development and deployment of python projects with varying dependencies in sync.

It’s disturbingly easy to set up:

  1. Install virtualenv
  2. Install virtualenvwrapper
  3. Put the virtualenvwrapper directory in version control
  4. create a virtualenv for each project

It’s that easy!!!

I’m a fan of using pip to install everything. It’s the future of python package management because it’s so flippin’ easy to use, as well as being sanely implemented.  The copypasta for the above setup runs something like this:

pip install virtualenv
pip install virtualenvwrapper
mkdir ~/.virtualenvs

Add the following to your .bashrc:

export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper_bashrc

then:

source ~/.bashrc
mkvirtualenv projectname
cd ~/.virtualenvs
git init

Now feel free to start using pip to build up the particular python environment the project will need, commiting the ~/.virtualenv directory to git as needed. When you’ve got your python libraries how you like, install virtualenv on the production server, and add it to the repository for your project. I’m thinking I’ll set it as a git submodule for Django projects, but so far I’ve just been keeping it as a separate repository for non-public in-development non-website projects.