Buildout configuration
To use Dexterity, you simply need to depend on the plone.app.dexterity package. You will also need to extend a Dexterity known good set (KGS) to make sure that you get the right versions of the packages that make up Dexterity. The easiest way to achieve this is to use a buildout that pins certain versions.
For a minimal buildout, see the installation how-to. In this section, will expand upon this to add some development tools.
To create the buildout, you can start with a standard Plone buildout and modify buildout.cfg to looks something like this. You should update the Dexterity and Plone versions as appropriate:
[buildout]
extensions = mr.developer buildout.dumppickedversions
unzip = true
parts = instance omelette zopepy test roadrunner
extends =
http://good-py.appspot.com/release/dexterity/1.1?plone=4.1.2
versions = versions
develop =
# If you're not using mr.developer to manage develop eggs, list eggs here. Globs OK.
# src/*
sources = sources
auto-checkout =
example.conference
[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
debug-mode = on
verbose-security = on
eggs =
Plone
example.conference
# development tools
plone.reload
Products.PDBDebugMode
zcml =
[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}
[zopepy]
recipe = zc.recipe.egg
eggs = ${instance:eggs}
interpreter = zopepy
scripts = zopepy
[test]
recipe = zc.recipe.testrunner
eggs =
example.conference
defaults = ['--exit-with-status', '--auto-color', '--auto-progress']
[sources]
example.conference = svn https://svn.plone.org/svn/collective/example.conference/trunk
You will see references to a package called example.conference. We'll create that shortly. Let's first go through and explain the buildout, however.
- We define two buildout extensions, mr.developer, which helps us manage our code, and buildout.dumppickedversions, which helps us keep track of which versions buildout has picked for our dependencies. If you are not familiar with mr.developer, you should read its documentation, in particular the documentation about the ./bin/develop command.
- We extend the version configuration for release 1.1 of Dexterity, targeted at Plone 4.1.2. You should adjust your Plone version accordingly. This allows Dexterity to update certain packages in Plone. You should check the Dexterity project page to discover which is the latest version. The known good set URL will give us the latest known good set of Dexterity packages, making it safe to depend on plone.app.dexterity in our example.conference product. The versions = versions line will make buildout use the known good set defined by the extended URLs.
- We tell mr.developer which section contain the sources to our packages with sources = sources (the [sources] section is at the end of the file). We also tell it to automatically check out and configure our example.conference package. This will check out the package form the given version repository URL, put it in src/ and ensure that it is configured as a develop egg.
- If you don't have a version repository yet, you can just put the egg in the src/ directory. The develop = src/* line will pick the egg up from there. Note: With mr.developer installed, we comment this out so that we don't get the same egg loaded twice.
- We configure a standard Zope instance and add two development tools to the eggs line:
- Products.PdbDebugMode will drop to a pdb shell when an exception occurs.
- plone.reload lets you go to localhost:8080/@@reload to reload code. Look at the plone.reload documentation for details
- We also add the Plone egg and our new package.
- We configure a standard Zope 2 server, which is used by our instance.
- We configure collective.recipe.omelette so that we get a set of links in parts/omelette giving access to all the code that is currently used by the instance. If you are on Windows, you will need to install junction.exe for this to work. See the omelette documentation for details.
- We install a testrunner. This will give us a bin/test command which can use to run our tests. Note: Only those eggs listed directly here will be available to the test runner. If you want to run tests for a dependency, you need to list it explicitly under the eggs option in the [test] part.
With this buildout, and a standard bootstrap.py file, you can run the usual python bootstrap.py; ./bin/buildout sequence to configure Plone and Dexterity. Before we do that, though, we need to create the package.
