Archives

We can add a 'versions' section in buildout.cfg to indicate the version of used recipes.

ie: buildout.cfg for myProject-1.0

[buildout]

parts =
zope2
instance

versions = myProject-1.0

[myProject-1.0]
plone.recipe.zope2install = 0.2
plone.recipe.zope2instance = 0.8

[zope2]
recipe = plone.recipe.zope2install
url = http://www.zope.org/Products/Zope/2.9.7/Zope-2.9.7-final.tgz

[instance]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
user = admin:admin
debug-mode = off
zodb-cache-size = 70000

This way, buildout will use plone.recipe.zope2install version 0.2 and plone.recipe.zope2instance version 0.8. For other stuff like setuptools it will "pick" the best distribution. We can tell buildout to generate an error when it "Picks" a version:

[buildout]

parts =
zope2
instance

versions = myProject-1.0
allow-picked-versions = false

[myProject-1.0]
plone.recipe.zope2install = 0.2
plone.recipe.zope2instance = 0.8

[zope2]
recipe = plone.recipe.zope2install
url = http://www.zope.org/Products/Zope/2.9.7/Zope-2.9.7-final.tgz

[instance]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
user = admin:admin
debug-mode = off
zodb-cache-size = 70000
I had a good discussion (by email) with Erik Forsberg about zopeskel.localcommands and how the "insert" stuff works. The discussion started by reporting a setuptools problem with zopeskel.localcommands. Setuptools fails with 'SyntaxError' if a template contains a .py file with cheetah variables.

He came with a suggestion to add '_insert' in the end of file names that should be treated in insert-mode so setuptools will not try to compile them (in case of .py files). I think it is a good suggestion.

So here is how it works now:

The '_insert' in the end of file names is required for .py files and optional for other kind of files. For zopeskel.localcommands there is no difference between "configure.zcml_insert" and "configure.zcml". Both will be treated in insert-mode. In the case of .py files if you don't add '_insert' in the end of their names, setuptools will fail with 'SyntaxError' when installing ZopeSkel. That's normal because of the template-variables.

For readability I recommend using the '_insert' syntax for files that their content should be inserted in existing project files.

As example here is the structure of the "portlet" template as is now:
 portlets/
+portlet_filename+.pt_tmpl
+portlet_filename+.py_tmpl

configure.zcml_insert
profiles/
default/
portlets.xml_insert
tests/
base_+portlet_filename+.py_tmpl

test_+portlet_filename+portlet.py_tmpl


(README.txt updated)