[Distutils] Installing subpackages under common superpackage
merwok at netwok.org
Tue Apr 17 19:42:06 CEST 2012
Le 03/04/2012 11:53, Rob Healey a écrit :
> The only way that I could tell you about a project that kind of does what
> you are looking for is already done somewhat in Distutils2-1.0a4 tarball...
This is incorrect. What Otto asked for is called namespace packages and
its status is a bit complicated.
- If you use only the standard library, then
http://docs.python.org/library/pkgutil#pkgutil.extend_path can be used.
On the packaging side, you can use distutils to package your two
projects and the second installed will overwrite __init__.py, which is
okay given that the contents will be the same.
- Most people use the flavor of namespace packages provided by
setuptools. (setuptools is a set of extensions to distutils which
people tend to love or hate.) I don’t remember how it differs from the
pkgutil flavor, but the docs for setuptools and distribute (a setuptools
fork) should explain it.
- There is an ongoing discussion to add better namespace packages in
Python 3.3. When it’s done, packaging/distutils2 will add support for it.
More information about the Distutils-SIG