Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get started with zc.buildout and Distribute?

I want to use buildout for dependency management, and I hear distribute is the new good way to manage installation of your project.

However, easy tutorials to get started seem to be thin on the ground. The most straight forward I've seen is Jacob Kaplan-Moss's Developing Django apps with zc.buildout (my use case is a web application), but that still isn't very clear as to what each piece of the chain does, and what best practices are.

How do I get going on this stuff? I want to do things right.

like image 946
Brad Wright Avatar asked Feb 21 '10 11:02

Brad Wright


1 Answers

I've just started documenting the whole toolchain at http://reinout.vanrees.org/weblog/tags/softwarereleasesseries.html (2010-02-25: still got to write the buildout and the pastescript article).

Basic toolchain idea: use setuptools to package your python code. Like the "developing django apps" article you mention: every application is its own package. Put your code in a directory and add a setup.py. The setup.py contains the version number, name, dependencies and so and you can run it to create a yourproject-0.1.tar.gz, for instance.

Downloading everything ("easy_install xyz") quickly makes a total and utter mess of your system python's site_packages. Probably with incompatible versions. Buildout (and for instance virtualenv) give you an isolated environment: installed packages are only installed local to that virtualenv/buildout.

Mess part 2: which versions do you want? To get any measure of repeatability and reliability, you've got to be able to control the versions you use ("Django 1.0 or 1.1?"). Buildout allows that.

like image 158
Reinout van Rees Avatar answered Nov 09 '22 02:11

Reinout van Rees