After finding out about plone.recipe.bundlecheckout yesterday, I
thought I’d mention infrae.subversion, a similar recipe for
zc.buildout. These are the key differences:

  • p.r.bundlecheckout allows you to specify one URL per part,
    whereas with infrae.subversion you can specify a list of URLs.
    Why does this matter? Because it helps you keep the exact URLs
    and therefore versions of the components that you use in your
    buildout configuration, which is better than keeping them in a
    svn:externals property.

  • infrae.subversion takes care not to wipe any changes that you
    might have done in the checkout. That is, you can safely use its
    checkouts for development.

    Why not instead make a separate products directory and use
    svn:externals for development? Because again, we want to keep
    all dependencies in the buildout configuration. And it’s good to
    keep the development buildout as close as possible to the
    deployment one, to minimize the chance of error. With
    infrae.subversion, you also have the advantage of being able to
    run bin/buildout and have all dependencies updated, instead of
    having to run svn up in some directory manually, which is a
    source of confusion.

  • p.r.bundlecheckout works with both SVN and CVS, while
    infrae.subversion only works with SVN.

The Silva buildout is an example of a buildout that uses
infrae.subversion.

plone.recipe.command

This is another buildout recipe that I should quickly mention. It can
be used to run arbitrary shell commands at install or update time.
Here is an example that uses the beforementioned infrae.subversion
recipe to install the latest Plone’s FCKeditor Product from SVN.
The reason for using plone.recipe.command here is that we need to
call the base2zope.py script to bootstrap the Product after doing
a checkout:

[my-products]
recipe = infrae.subversion
urls =
  https://svn.plone.org/svn/collective/FCKeditor/trunk FCKeditor
  ...
[prep-fckeditor]
recipe = plone.recipe.command
command =
    ${buildout:executable} ${buildout:directory}/parts/my-products/FCKeditor/utils/base2zope.py
update-command = ${prep-fckeditor:command}

You can find more buildout recipes in PyPI.

Daniel Nouri: infrae.subversion: a recipe against disaster

Originally from Planet Plone