[Zope-dev] Re: ploneout - Or how using zc.buildout for a common Zope2 project might look like

Hanno Schlichting plone at hannosch.info
Thu Jan 18 06:48:58 EST 2007


Hi,

sorry, I'm catching up with my mail slowly these days...

Martijn Faassen wrote:
> Hey,
> 
> Martin Aspeli wrote:
>> Martijn Faassen wrote:
> 
>>> If you used a pure buildout solution you'd have gotten an ImportError on 
>>> elementtree that you'd need to fix by altering a setup.py somewhere.
>> I did get an ImportError. The way I fixed it was by running 
>> 'easy_install elementtree'; perhaps I should've updated the buildout or 
>> the deps of one of the eggs instead.
> 
> Right, you'd want to write this dependency down, probably in an egg 
> dependency if you can do it, so it gets pulled in automatically.

Yep, we should note both elementree (required by Archetypes, more
precisely Marshall anyways since Plone 2.5) and PIL (python-imaging) as
dependencies somewhere in ploneout.

> [snip]
>>> So if you have a project with a setup.py called 'foo' under the buildout 
>>> root, you'd say this in buildout.cfg:
>>>
>>> [buildout]
>>> develop = foo
>> Aha, didn't know that. Interesting.
>>
>> How does that work if I then decide to add another package to the 
>> buildout though? Do I then end up wiping everything and starting from 
>> scratch (e.g. blank zope instance part) just to get that one egg to be 
>> installed? Scary...
> 
> If you change the configuration of your Zope instance to include that 
> egg then yes, your instance will be rebuilt. Note that the object 
> database is in another part, so it won't be wiped. Yeah, scary. It would 
> be less scary if Zope instances were less complicated and if 
> configuration were maintained somewhere else.

One thing to correct here, is that I haven't found the time to make the
Data.fs and independent part, so while in the Zope3 recipes, the
instance and the database are separated, they are currently not in the
Zope2 recipes. There's an XXX comment in the Zope2 instance recipe, that
marks the commented out section of the recipe, that would need to be
adjusted.

> [snip]
>> I guess I don't understand how I'm supposed to use this *during 
>> development* where I may be finding, creating, adding and removing my 
>> own eggs or other old-style Products throughout the life of the problem.
> 
> You change your dependencies in the respective setup.py files. 
> Considering old style Products I have no idea what the solution strategy 
> is of the recipes involved.

Be careful here, as I noted I did not understand the way buildout's egg
and develop section should really work, so my current Zope2 recipes
don't use that at all.

So if you are confused at some points, that's because you are not
talking about the same approach ;)

>>   - Having to re-create the Data.fs each time is unacceptable
> 
> It shouldn't do that unless you change the configuration of the data 
> section specifically. At least that's the case for the Zope 3 recipes.

See above, the independent database part is still missing.

>>   - Having to wait half an hour while buildout re-downloads and 
>> re-configures everything is hardly great
> 
> That's not what it should be doing - the Zope 2 software home shouldn't 
> be touched, for instance. Creating a new instance doesn't cost a lot of 
> time, though.

Indeed, as noted somewhere I even introduces a local offline option for
the Zope2 checkout recipe, so it shouldn't get downloaded or updated at
all, once checked out, unless buildout thinks some configuration of that
part has changed and it wipes the part completely.

I'm not sure but it might be that the current recipes being in
development mode themselves cause trouble here. I'm not sure how exactly
 buildout determines the checksum of a recipe, but if the SVN revision
number is somehow involved, updating the ploneout checkout itself could
cause some trouble, as the recipes are included in them as well. But
this is only a wild guess ;)

> You can stop it from doing redownloads (if you know it isn't necessary) 
> by doing:
> 
> bin/buildout buildout:offline=true

Yep, you need to know the above command. In general it will not attempt
to update any part, but if buildout determines that a parts options or
the underlying recipe has changed it will still wipe and rebuild from
scratch.

As a general comment, the current ploneout config should probably be
changed to at least not include any eggs as parts, but should use
buildouts approach of putting their checkout in src/ instead not
managing them as a part and including all those in the develop section
of buildout.

Hanno (still catching up with this thread...)



More information about the Zope-Dev mailing list