[Zope3-Users] How to organize common code for Z2 and Z3

Lennart Regebro regebro at gmail.com
Wed Apr 13 11:59:56 EDT 2005


> I think the trick would be to write code for Zope 3 and put it
> in a top-level package, like "textindexng". Inside this package you add a
> package "TextIndexNG" that is expected to be added to Zope 2's
> lib/python/Products.

Seems reasonable. But my gut reaction is to have this type of cvs/svn layout:

TextIndexNG/
TextIndexNG/setup.py # distutils stuff
TextIndexNG/TextIndexNG # for Zope2
TextIndexNG/src
TextIndexNG/src/textindexng

That way you just check it out and tar it for distrubution.

You install it for zope3 with "python setup.py". setup.py will be
constructed to completely ignores everything in
TextIndexNG/TextIndexNG.

You install it for Zope2 by copying TextIndexNG/TextIndexNG to
Products and running distutils again.

If src/textindexng is all python and no C or other funny business you
could actually copy it to Products/TextIndexNG/ as well. If that is
the case, as Zope2 distribution with that layout could be provided as
well.

Anything bad with this?

-- 
Lennart Regebro, Nuxeo     http://www.nuxeo.com/
CPS Content Management     http://www.cps-project.org/


More information about the Zope3-users mailing list