Build Python in Buildout

erstellt von Jens W. Klein — 17.07.2008 20:10

zc.buildout to build a custom python.

Python-LogoSystems Python is sometimes polluted with different packages from somewhere. This happens and deleting packages conflicting with the specific Buildout is not the clean solution.

Having a clean Python helps a lot. It can be shared between buildouts. Python is easy to build anyway, but using Buildout for this task its again easier and more predictable and reduces the affinity for mistakes. Here is my buildout.cfg for this task.

[buildout]
python = python
parts =
    python
    pythonbin

[python]
recipe = zc.recipe.cmmi
url = http://www.python.org/ftp/python/2.4.5/Python-2.4.5.tgz
executable = ${buildout:directory}/parts/python/bin/python2.4
extra_options=
    --enable-unicode=ucs4
    --with-threads
    --with-readline

[pythonbin]
recipe = plone.recipe.command
command = ln -s ${python:excecutable} ${buildout:bin-directory}/python

If youre on OSX you want to add MACOSX_DEPLOYMENT_TARGET=10.5 to extra_options. The python is binary-compatible (pickles, ZODB) with Debian/Ubuntus (and most others) binary - it uses the same unicode flavor.

I think its also a good idea to use this style of python-build for the new plone.org deployment setup. [UPDATE: While testing this for new.plone.org I changed pythonbin to just symlink the binary]

Artikelaktionen