On Tue, Apr 3, 2012, at 11:41 PM, Jonathan Ballet wrote:
On Tue, Apr 03, 2012 at 04:35:17PM +0100, Otto Maddox wrote:
I have a Python project which follows a client-server architecture. It is natural to develop it as two different projects and in two different source distributions, myproject-server.tar.gz and myproject-client.tar.gz.
Neither package depends on the other, but because they are part of a larger, overarching project, I want install each of them so that they appear as subpackages (myproject.server and myproject.client) under a common superpackage (myproject). I am looking for the cleanest and most correct way to do this using distutils and setup.py, so that I can end up with a structure like this:
You would probably interested about setuptools' namespace support for doing this, you can have a look at http://packages.python.org/distribute/setuptools.html#namespace-packages
That looks like it might be do the trick. I will evaluate this sort of solution, and compare it with Rob's suggestion to use distutils2.
Additionnaly, if you are looking for examples, the Zope community is well known for the use of namespaced packages - have a look at the zope., zc., z3c., collective., plone., etc. namespaces.