On Fri, Mar 28, 2008 at 12:18 AM, Dennis Kempin <python@dennis-kempin.de> wrote:
Hi folks,

i really like the setuptools project, it makes my life much easier, but
recently i stumbled over the following problem:

My Project constist of 2 main egg distributions and a bunch of "plugin" eggs.

The first Problem ist: These projects are in the same source tree. like this:
src/project/master
src/project/plugins (namespace package)
src/project/plugins/pa
src/project/plugins/pb
src/project/plugins/pc

Well not a problem for setuptools since you can specify which packages to
include into a distribution.
But the problem is: when i call setup() multiple times in one setup.py file
everything gets completly messed up. All egg files contain the whole project
source.

What I would do is to create several eggs with these names:

project.master
project.plugin.pa
project.plugin.pb
project.plugin.pc

Then organize the code like this on your box/repo:

src/project/packages
    project.master/
                 setup.py
                 etc...

    project.plugin.pa
               setup.py
               project
                     plugin
                          pa
                             the code
    etc..


This is how Zope 3 is organized for instance: a bunch of eggs, that share the same namespaces
but that are separated in independant folders, since setuptools allow several packages
to share the same top namespace.



My second solution was to create multiple setup.py files (setup-master.py,
setup-pa.py, and so on) and call them via system(). But this resulted in some
conflicts in the build directory.

So well.. is it possible (and especially how is it possible) to create
multiple egg files within one python instance (one setup.py file that is
executed)?

I am not sure you can, but if you do as mentioned below, you should be fine.
 


And another question:
When i have all the plugin egg files packaged. I want to create a new egg file
(project-dist) to distribute the master and all of its plugins (which are
simply copied to a /etc/ folder).
Thus a single egg file that installs the master and copies some egg files to a
specified folder.

If your application is based on a collection of eggs, you can add them in the "install_requires"
meta-data of a "main" egg. This will fetch them and install them as dependencies.
But each egg has to be available at PyPI

Another solution to wrap an egg-based application is to use a tool like zc.buildout.

Now this is how I work and do with eggs, and how most people do in Zope community,
but there might be other ways, I don't know.

Regards,
Tarek


--
Tarek Ziadé | Association AfPy | www.afpy.org
Blog FR | http://programmation-python.org
Blog EN | http://tarekziade.wordpress.com/