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

Maurits van Rees m.van.rees at zestsoftware.nl
Fri Feb 18 16:28:08 CET 2011

Op 18-02-11 10:07, Chris Withers schreef:
> Hi All,
> I'm using buildout to develop a package that uses sqlalchemy and
> sqlalchemy-migrate.
> As a result, I'd like to test with various real database drivers; mysql,
> postgres, etc.
> However, I don't want to force anyone who wants to check out and run the
> tests to have all supported database drivers available and compiled.
> 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': [

If you want to install these extra dependencies in e.g. a buildout 
config, you specify plone.app.discussion[test] as an egg.

Maurits van Rees
Web App Programmer at Zest Software: http://zestsoftware.nl
Personal website: http://maurits.vanrees.org/

More information about the Distutils-SIG mailing list