[Zope3-dev] eggs in a Zope 3.3 instance

Martijn Faassen faassen at infrae.com
Thu Jun 15 10:42:28 EDT 2006


Hi there,

I'm trying to develop with eggs now in a straight Zope 3.3 instance. 
I've make it all work with Schooltool, but that's hardly a "normal" Zope 
3 install, and now I'm trying to figure out the way of working with egg 
dependencies in the face of a Zope 3 instance home setup.

The goal of this mail is to share my experiences, and to see whether 
perhaps there are other strategies that avoid having to edit various 
files (as I had to resort to).

The goal: to allow the installation of eggs into an instance's 
lib/python directory.

A command along the following lines, ran from the instance home, 
succesfully installs an egg:

PYTHONPATH=lib/python/ easy_install 
--find-links=http://download.zope.org/distribution/ 
--install-dir=lib/python zc.catalog

unfortunately this egg won't be picked up by the test runner or the Zope 
3 application unless I doctor the bin/test, bin/zopectl and bin/runzope 
files to add the lib/python directory a a site:

bin/test:

   after the "sys.path[0:] = .." line, add

     import site; site.addsitedir(sys.path[0])

bin/zopectl

   after the "sys.path[:] = .." line, add:

     import site; site.addsitedir(sys.path[0])

and the same in bin/runzope

This allows the test runner to run and Zope to start. The test runner 
won't pick up tests inside of eggs though, so you can only run tests in 
non-eggs that may be installed.

It'd be nice if this all just worked sright away with Zope 3.3, though 
it's too late to be adding new features... Perhaps other people are 
using different patterns to make this work? Please let me know!

Regards,

Martijn


More information about the Zope3-dev mailing list