[Import-SIG] PEP 420: Implicit Namespace Packages

PJ Eby pje at telecommunity.com
Mon Apr 23 02:29:58 CEST 2012

On Sun, Apr 22, 2012 at 7:51 PM, Michael Foord <fuzzyman at gmail.com> wrote:

> On 19 April 2012 21:18, Eric V. Smith <eric at trueblade.com> wrote:
>> This reflects (I hope!) the discussions at PyCon. My plan is to produce
>> an implementation based on the importlib code, and then flush out pieces
>> of the PEP.
>> In particular, I want to make sure the PEP addresses the various
>> objections that were raised, especially by Nick.
> So a namespace package is a directory (tree) on sys.path. For a standard
> Python install how will these be installed?
> If you need to install "foo.bar" and "foo.baz" will distutils and
> packaging do the right thing? (And what specifically is the right thing for
> Python's own package management tools - merging the namespace packages or
> keeping them separate somehow?)

I don't know about 3.x distutils or packaging specifically, but I do know
that 2.x distutils will install packages compatibly with this approach if
you list the child packages but NOT the namespace package in your setup.py.
 So if one distribution lists 'foo.bar' and the other lists 'foo.baz', but
*neither* lists 'foo', then the subpackages will be installed without a
foo/__init__.py, and that will make it work.

If packaging and 3.x distutils inherit this behavior from the 2.x
distutils, then that would be the simplest way to do it.  (And if you
install to different directories, the parts will get merged.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20120422/22c5467e/attachment-0001.html>

More information about the Import-SIG mailing list