Personal tools
You are here: Home Weblog Archive 2007 December 10 Zope 3 dependencies in Zope 2 buildout
Document Actions

Zope 3 dependencies in Zope 2 buildout

by jfroche last modified 2007-12-10 19:23
Filed Under:

Describe a buildout recipe to avoid fetching zope 3 libraries when installing eggs with zope 3 depedencies in a zope 2 buildout

I got tired removing zope.interface, zope.component, zope.deferredimport, zope.event, ... of my eggs folder inside my buildout when installing package such as z3c.sqlalchemy in my Zope2 / Plone buildouts ...

After the discussion on Zope3-users list and thanks to Jim lights, I wrote a really simple recipe which just create egg links to zope libraries in your develop-eggs so that setuptools can see that the dependencies are already satisfied.

So if you list your zope library :

$ ls yourbuildout/parts/yourzope2/lib/python/zope

app configuration documenttemplate exceptions i18n __init__.py pagetemplate schema structuredtext testbrowser viewlet
cachedescriptors contentprovider dottedname formlib i18nmessageid interface proxy security tal testing
component deprecation event hookable index modulealias publisher server tales thread

You will get

$ ls yourbuildout/develop-eggs

zope.app.component.egg-info zope.app.security.egg-info zope.dottedname.egg-info zope.interface.egg-info zope.structuredtext.egg-info
zope.app.egg-info zope.app.testing.egg-info zope.event.egg-info zope.modulealias.egg-info zope.tal.egg-info
zope.app.event.egg-info zope.cachedescriptors.egg-info zope.exceptions.egg-info zope.pagetemplate.egg-info zope.tales.egg-info
zope.app.i18n.egg-info zope.component.egg-info zope.formlib.egg-info zope.proxy.egg-info zope.testbrowser.egg-info
zope.app.interface.egg-info zope.configuration.egg-info zope.hookable.egg-info zope.publisher.egg-info zope.testing.egg-info
zope.app.pagetemplate.egg-info zope.contentprovider.egg-info zope.i18n.egg-info zope.schema.egg-info zope.thread.egg-info
zope.app.publisher.egg-info zope.deprecation.egg-info zope.i18nmessageid.egg-info zope.security.egg-info zope.viewlet.egg-info
zope.app.schema.egg-info zope.documenttemplate.egg-info zope.index.egg-info zope.server.egg-info

Where each of these file will be seen for setuptools as an egg:

$ cat yourbuildout/develop-eggs/zope.app.component.egg-info

Metadata-Version: 1.0
Name: zope.app.component
Version: 0.0

Sure this might look like an ugly hook but I can't wait for zope 2 eggification

Clever

Posted by Anonymous User at 2007-12-11 00:48
I like it, in an ugly, hacky, cool kind of way. :-)

- Martin/optilude

No distribution and broken links

Posted by Anonymous User at 2007-12-11 10:42
Jean-Francois, can you upload the egg or fix the link to your SVN so that we can actually see and use this? I'm really eager to do so!

... and maybe then I can also conclude if it's great in a hacky or in a beautiful way. :-)

--Daniel Nouri

RE: No distribution and broken links

Posted by jfroche at 2007-12-11 16:32
Done, fixed the url and added egg on pypi... first time on pypi

Thanks!!

Posted by Anonymous User at 2007-12-19 16:24
This is very, very useful! Finally, I can depend properly on Zope 3 eggs.

-- Daniel

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: