[Distutils] Regression in zc.buildout 1.4.0?

Jonathan Ballet jon at multani.info
Fri Aug 28 11:35:07 CEST 2009


Hi,

We often use the 'extends' feature of Buildout to create customized
version of configuration files per-developer or per-buildbot.

One nice feature of Buildout was that I can easily extend another
configuration file and add part to those specified in this 'base' file.
Then, if I launched the Buildout, I got all the parts from the base file
plus the one I defined in *my* configuration file. I was very happy.


Unfortunately, it seems that the new release 1.4.0 of Buildbot has broke
this feature and the new behavior seems to be: install only parts which
are *strictly* defined in the configuration file used by the Buildout,
and not the 'inherited' ones anymore.


I wrote a quick doctest which illustrate this problem (merely adapted
from other doctests):

===========================================================
Create a test recipe, which only prints itself

>>> mkdir('recipes')
>>> write('recipes', 'testrecipe.py',
... """
... import logging, os, zc.buildout
...
... class TestRecipe:
...
...     def __init__(self, buildout, name, options):
...         self.name, self.options = name, options
...
...     def install(self):
...         logging.getLogger(self.name).info(
...             'This is the test recipe which is installing!')
...         return ''
...
...     def update(self):
...         logging.getLogger(self.name).info(
...             'This is the test recipe which is updateting!')
... """)

And create a dummy package to use it:

>>> write('recipes', 'setup.py',
... """
... from setuptools import setup
...
... setup(
...     name = "recipes",
...     entry_points = {'zc.buildout':
...            ['testrecipe = testrecipe:TestRecipe']},
...     )
... """)

Now, this is a base buildout configuration file, which defines and uses
by default one part:

>>> write('base.cfg', """\
... [buildout]
... develop = recipes
... parts = base-part
... [base-part]
... recipe = recipes:testrecipe
... """)

And another buildout configuration file, which extends the base
configuration file, and add to it another part:

>>> write('buildout.cfg', """\
... [buildout]
... extends = base.cfg
... parts += buildout-part
... [buildout-part]
... recipe = recipes:testrecipe
... """)

If we run the buildout, then we should install first the part from the
base configuration file, then the part from the other buildout
configuration file:

>>> print system(buildout)
Develop: '/sample-buildout/recipes'
Installing base-part.
base-part: This is the test recipe which is installing!
Installing buildout-part.
buildout-part: This is the test recipe which is installing!
<BLANKLINE>
===========================================================


...which fails with latest versions of Buildout with:

===========================================================
File "..." line 52, in extends.txt
Failed example:
print system(buildout)
Expected:
Develop: '/sample-buildout/recipes'
Installing base-part.
base-part: This is the test recipe which is installing!
Installing buildout-part.
buildout-part: This is the test recipe which is installing!
<BLANKLINE>
Got:
Develop: '/sample-buildout/recipes'
Installing buildout-part.
buildout-part: This is the test recipe which is installing!
<BLANKLINE>
===========================================================

As you can see, the 'base-part' is not installed anymore. I bisected the
problem down to the merge of the 'tlotze-download-api' branch (the bug
didn't not occured before).

I'm not sure the behavior I expect was actually really documented (I
don't find it in the documentation) but this was nice!
Should I report a bug for this or was it a necessary change for the new
version of Buildout?


Thanks!

-Jonathan



More information about the Distutils-SIG mailing list