Trade-off between buildout and pip: in combination with fabric

Tags: python, django, buildout

I noticed a question on stackoverflow about Fabric + buildout as opposed to Fabric + pip + virtualenv. Good question! Why? Because Fabric changes the regular trade-off between buildout and pip:

  • Pip is simple, but only installs python packages.

  • Buildout is more complex, but installs python packages plus a whole lot more.

“A lot more” includes things like configuring supervisor, generating an apache file, creating directories and so. Either you automate it so that buildout does it for you or you hope that your colleague reads the README and actually does everything that needs doing before complaining to you that “it doesn’t work”.

Fabric is also used for automation. The things you’d put into your fabfile.py to set up your production environment on the server, those very same things you can of course run locally. So a bin/fab setup_local_machine could take the place of “read the readme, please, after you’ve run pip”. Which could take away some of the need for buildout.

My suggestion: look on pypi for buildout recipes to see if they are handy for you. Do they save you enough work to make it worthwhile to dive into the extra complexity that a full buildout configuration means? There’s a lot that can be done for you for free. Do you really want to re-invent the wheel by hand in a custom fabfile.py?

If you can do it quickly with a fabfile, there might be no need to look at buildout. Anyway: take a look!

Note: I’m using both fabric and buildout. Buildout sets up everything I can get it to set up. I use fabric to do the git checkout of the buildout and restarting nginx and so: everything outside of buildout’s control.

(Btw, I’ve answered the question, too).

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):