[Distutils] [buildout] including optional python packages for testing

Chris Withers chris at simplistix.co.uk
Fri Feb 18 16:37:52 CET 2011

On 18/02/2011 15:28, Maurits van Rees wrote:
>> So, I'm looking for some way of specifying "optional eggs" when running
>> the buildout, and not in buildout.cfg so they don't accidentally get
>> checked in.
>> How can I achieve this?
> Next to the install_requires in setup.py you add an extras_requires;
> here is an example from the plone.app.discussion package:
> extras_require = {
> 'test': [
> 'plone.app.testing',
> 'interlude',
> ]
> },
> If you want to install these extra dependencies in e.g. a buildout
> config, you specify plone.app.discussion[test] as an egg.

Hmm, this isn't quite what I'm talking about.

If I did it this way, I'd need to define an extras_require section for 
each type of database, so about 4-6 sections.

These also aren't really dependencies of my package, since they're never 
imported by my package code, so it feels wrong to declare them as 


Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

More information about the Distutils-SIG mailing list