"Buildout is an exceedingly civilized way to develop an app."
--- Jacob Kaplan-Moss, creator of Django
Let's take Django as an example:
Single package
Easy to install and start playing with
Part of it's success
Framework has no dependencies ? Cool.
OTOH non trivial projects have many of them (good thing ™). Let's take Django as an example:
Developers work in teams
Recreating the environment and dependencies walk in the park.
Different framework versions
Isolated environment
Deployment headaches: paths, FastCGI, WSGI
Python-based reproducible build and configuration system for multi-part applications:
buildout.cfg
[buildout]
parts =
develop = .
Each part is handled by a recipe which is downloaded as needed. There are many of them, search buildout @PyPI. e.g:
Get it:
wget http://svn.zope.org/*checkout*/\
zc.buildout/trunk/bootstrap/bootstrap.py
Run it:
[meir@metallix buildout]$ python bootstrap.py
Creating directory '/home/meir/tmp/buildout/bin'.
Creating directory '/home/meir/tmp/buildout/parts'.
Creating directory '/home/meir/tmp/buildout/develop-eggs'.
Generated script '/home/meir/tmp/buildout/bin/buildout'.
[buildout]
parts = python
eggs =
docutils
pygments
[python]
recipe = zc.recipe.egg
interpreter = mypython
eggs = ${buildout:eggs}
[meir@metallix buildout]$ bin/buildout
Installing python.
Generated interpreter '/home/meir/tmp/buildout/bin/mypython'.
It's all in the paths, let's examine bin/mypython:
#!/usr/bin/python
import sys
sys.path[0:0] = [
'/home/meir/.buildout/eggs/docutils-0.6-py2.6.egg',
'/home/meir/.buildout/eggs/Pygments-1.1.1-py2.6.egg',
]
...
[buildout]
parts = python django
develop = .
eggs = django-bidi-utils
[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}
[django]
recipe = djangorecipe
version = 1.0.2
project = bidiutils
projectegg = bidiutils
settings = testsettings
test = bidiutils
eggs = ${buildout:eggs}
Config files can extends other ones, useful for different scenarios, e.g staging.cfg:
[buildout]
extends = buildout.cfg
parts +=
magic-debugging-egg
[magic-debugging-egg]
recipe = ...
$ bin/buildout -c staging.cfg
Can't find the receipe ? Need customization ? don't despair, recipes are python after all, write your own.
Each recipe is a class implementing install, update and optional uninstall. For more info, see Writing recipes in the buildout tutorial.
Contact: Meir Kriheli, meir@mksoft.co.il