Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A recipe to simulate eggs for non eggs modules installed at python level

Project Description


Detailed Documentation


Sometimes you can’t add eggs through your buildout engine or easy_install, for example if some dev libraries are lacking on your system, or are too old, etc.

But you can install module directly on your system using your system’s packaging utility (port install python-xxx, apt-get install python-xxx or with .msi installers for Windows. In example python-ldap or lxml are somehow difficult to install on Windows using source eggs, and are usually available as binary installers.

Then, though you get all you need in your python environment, your buildout may fail because an egg is missing.

This recipe will make buildout believe that such missing eggs are available and installed, when your app will use the system wide Pyhton packages you installed by your way.

Yes, I know you should usually not do this but sometimes there’s no other (easy) way to have your buildout completed.


You have to add ON TOP OF YOUR PARTS a collective.recipe.mockedeggs recipe part:

parts = mocked-eggs
        other parts...


The recipe supports the following options:


The list of eggs you want to mock, with their version number, as for example:

mocked-eggs =
    Markdown = 1.7

Example usage

We’ll start by creating a buildout that uses the recipe:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = mocked-eggs-test
...         zopepy
... eggs = mocked1
...        mocked2
... [mocked-eggs-test]
... recipe = collective.recipe.mockedeggs
... mocked-eggs =
...      mocked1=1.0
...      mocked2=  2.0
... [zopepy]
... recipe = zc.recipe.egg
... interpreter = zopepy
... eggs = mocked1
...        mocked2
... """)

Running the buildout gives us

>>> print 'start...\n', system(buildout)
Installing mocked-eggs-test.
mocked-eggs-test: Mocked eggs mocked1, mocked2.

>>> import os
>>> os.path.exists('mocked-eggs-test')
>>> os.path.exists('mocked-eggs-test/fake-mocked1')
>>> os.path.exists('mocked-eggs-test/fake-mocked2')

>>> setup1 = open('mocked-eggs-test/fake-mocked1/').read()
>>> '1.0' in setup1
>>> "'mocked1'" in setup1
>>> binary = open('bin/zopepy', 'r').read()
>>> 'mocked-eggs-test/fake-mocked1' in binary


  • “Thomas Desvenain”, Author
  • “Gilles Lenfant”, Contributor

Change history

1.0rc1 23/03/2010

  • we can have spaces in mocked eggs declaration (myegg = 2.0 is allowed)
  • better documentation [glenfant,tdesvenain]

1.0a1 10/03/2010

  • Initial release [tdesvenain]
  • Created recipe with ZopeSkel


Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
collective.recipe.mockedeggs-1.0rc1.tar.gz (5.9 kB) Copy SHA256 Checksum SHA256 Source Mar 23, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting