James Tauber

journeyman of some

blog > 2009 > 01 > 31 >

Moving to Distutils

reposted from http://code.google.com/p/django-hotclub/wiki/MovingToDistutils

the how and why of Pinax's move to distutils

Pinax is changing the way that external dependencies are brought in during development on trunk. Note that this document is only talking about changes in how things work and will work on trunk, NOT necessarily how they will work with a released version of Pinax.

Until recently, Pinax had two choices for a given external dependency:

However, there are problems with this approach:

To solve these problems and more, Pinax is switching to a distutils-based approach. This means:

In order to develop from the Pinax trunk, you will need to use pip. Because some external dependencies are retrieved via git and bzr you will also need those if using Pinax trunk.

Although we will eventually have per-project requirements files, there are currently two requirements files that describe to pip what dependencies to bring in and how:

The former is actually a requirement of the latter so you can bring in all external dependencies with:

pip install -r pinax/requirements/external_apps.txt

We strongly recommend the use of virtualenv in conjunction with pip to allow isolated environments to be set up without Pinax having to hack PYTHONPATH.

Categories:
prev « python » next
prev « django » next
prev « pinax » next

Comments (2)

Fabian Neumann on Jan. 31, 2009:

Nice to see this move. I'm using a similar solution for a current client project.

Although I often get inspiration by Pinax' code using svn:externals (even svn at all ;) was never an option for me.

mitja on Feb. 1, 2009:

In my latest project I use a combination of zc.buildout and distutils. The django project is compiled with zc.buildout and reusable apps are written with a distutils setup.py.

The advantage to distutils/virtualenv is that I find it easier to deploy and upgrade external dependencies once the setting (buildout.cfg) is done and fixed.

Did you consider buildout and if yes: What do you think about this approach?

Created: Jan. 31, 2009
Last Modified: Jan. 31, 2009
Author: James Tauber