Z3 ECM Enterprise Content Management for Zope3

Cheap binary Windows eggs

Thanks to Hanno Schlichting's howto, I've figured out how to create Windows eggs of those packages that have C extensions. This approach doesn't need Microsoft Visual Studio, nor does it require you to wade through a bunch of free Microsoft downloads that don't really work in the end anyway.

Here's what I did:

  1. Installed the standard Python 2.4 distribution from the MSI package.

  2. Installed the MingW compiler (into the standard location C:\MingW)

  3. Created C:\Documents and Settings\Philipp\pydistutils.cfg and put the following text in it:

    [build]
    compiler=mingw32
    

    This tells distutils to always use the MingW compiler whenever it has to compile something from C.

  4. Went to the Control Panel -> System -> Advanced tab and clicked on the Environment Variables button. There I appended the following text to the the Path environment variable, adding the Python interpreter as well as MingW's programs to the search path:

    ;C:\Python24;C:\MingW\bin
    

    Then I added another environment variabled called HOME with the following value:

    C:\Documents and Settings\Philipp
    

    This points distutils at the pydistutils.cfg file that I created earlier (you can put the pydistutils.cfg file anywhere you want, you just need to make sure that the HOME environment variable points to the directory).

  5. With that in place, I am able to take any tarball (e.g. zope.interface-3.4.0.tgz), unzip it and create a Windows egg from it like so:

    python setup.py bdist_egg
    

What's more, with a setup like this, it is easily possible to install Zope 3 completely from eggs (e.g. using zc.buildout) even if there are no pre-built Windows eggs on the Cheeseshop. More specifically, with this setup, zopeproject (which is really just a convenience tool over zc.buildout) works like a charm on Windows now.

Posted by Philipp von Weitershausen @ 07/26/2007 09:49 PM. - Categories: Python, Zope 3 -  0 comments