Personal tools
You are here: Home Blog Building custom Python in the same buildout as Zope2

Building custom Python in the same buildout as Zope2

How to write a single buildout that builds a custom Python from source and uses it for Zope installation and creation of instance. I want to run that buildout with the system Python.

I wanted a buildout that would install a custom Python from source and use that custom Python to install and create a Zope2 instance.

The buildout recipe zc.recipe.egg comes with a python option that points to a section that specifies a Python executable.

For example, with the buildout below, Python 2.4.6 is downloaded, built from source, then used to build the PIL egg found on download.zope.org.

[buildout]
parts =
    python
    PILwoTK

[python]
recipe = zc.recipe.cmmi
url = http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz

[python2.4]
executable = ${buildout:directory}/parts/python/bin/python

[PILwoTK]
python = python2.4
recipe = zc.recipe.egg
find-links = http://download.zope.org/distribution/

Because the recipe plone.recipe.zope2instance relies on zc.recipe.egg, it also supports the python option.

However, the recipe plone.recipe.zope2install did not support that nice option. I added the option and made a new 3.3 release.

The buildout hereunder builds a custom Python from source and uses it for Zope installation and creation of instance :

[buildout]
parts =
    python
    zope2
    instance

versions = versions

[versions]
zope2-url = http://www.zope.org/Products/Zope/2.10.11/Zope-2.10.11-final.tgz

plone.recipe.zope2install=3.3
plone.recipe.zope2instance=3.9

[python]
recipe = zc.recipe.cmmi
url = http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz

[python2.4]
executable = ${buildout:directory}/parts/python/bin/python

[zope2]
recipe = plone.recipe.zope2install
url = ${versions:zope2-url}
python = python2.4

[instance]
python = python2.4
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
user = admin:admin
http-address = 8080
debug-mode = off
verbose-security = off

eggs =
zcml =
products =

Enjoy !

Document Actions