Personal tools
You are here: Home buildout

buildout

March 10, 2008

David Glick: collective.recipe.omelette: for more navigable eggs

Crack 'em open and mix 'em together...

I've been using zc.buildout for a few months now, and am quite happy with it.  However, I got tired of navigating to my egg cache, locating the right package (and version) within a long flat list, and then clicking a few more times to actually get to the contents of the package.  And I was looking for a project to practice my buildout recipe fu.

So I created collective.recipe.omelette.  It's a simple buildout recipe that takes all your namespace-packaged eggs and merges their contents together into a single directory tree, in its own parts directory, with symlinks to the actual egg contents.  The result looks much the lib/python of days gone by.  So instead of:

egg-cache/
    my.egg.one-1.0-py2.4.egg/
        my/
            egg/
                one/
                    (contents of first egg)
    my.egg.two-1.0-py2.4.egg/
        my/
            egg/
                two/
                    (contents of second egg)

you can now make use of:

parts/
    omelette/
        my/
            egg/
                one/
                    (contents of first egg)
                two/
                    (contents of second egg)

with obvious advantages in navigability and greppability.

Collective.recipe.omelette is available from the Cheese Shop.  You can add an omelette to your buildout by making the following additions to buildout.cfg (assuming you have a part called instance and you want to generate symlinks for its eggs), and then re-running your buildout:

[buildout]
...
parts =
    ...
    omelette

[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}

One caveat: Since this makes use of symlinks, it of course won't work on a filesystem that doesn't support symlinks, such as Windows'.


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: