<div dir="ltr">Just to recap:<div><br></div><div>1. if
you don't put namespace_packages in the setup.py, then it will uninstall the
shared __init__.py when you uninstall any of the packages</div><div>2. <span style="font-size:11pt;font-family:Calibri">If you put
     namespace_packages, then there is a pth file created for the shared
     directory (site-packages/foo) and no foo/__init__.py is
     created (even if it is in your package)</span></div><div><font face="Calibri"><span style="font-size:14.6667px">#2 - breaks things like : doing a source checkout that participates in this namespace_package...If you do this then only the lib/site-packages/foo/<modules> are importable</span></font></div><div><font face="Calibri"><span style="font-size:14.6667px"><br></span></font></div><div><font face="Calibri"><span style="font-size:14.6667px">Solution appears to be:</span></font></div><div><font face="Calibri"><span style="font-size:14.6667px"><br></span></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 1, 2015 at 7:17 AM, KP <span dir="ltr"><<a href="mailto:patter001@gmail.com" target="_blank">patter001@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">yes, both of those statements are true.<div><br></div><div>However, with the namespace_packages = ['foo'], the lib\site-packages\foo\__init__.py does not get installed (even though it is in the source tree). Instead there's just a dir with "foo/bar/__init__.py" and "foo/blah/__init__.py". I will try to look in the "wheel" side of things next I guess. Perhaps pip is doing something since it seems to install even source distributables by first converting to a wheel.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Dec 1, 2015 at 1:38 AM, Marius Gedminas <span dir="ltr"><<a href="mailto:marius@gedmin.as" target="_blank">marius@gedmin.as</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><span>On Mon, Nov 30, 2015 at 06:59:31PM -0500, KP wrote:<br>
> I'm not sure where the issue is, but when I specify a namespace_package in<br>
> the setup.py file, I can indeed have multiple packages with the same base<br>
> (foo.bar, foo.blah, etc...). The files all install in to the same<br>
> directory. It drops  the foo/__init__.py that would be doing the<br>
> extend_path, and instead adds a ".pth" file that is a bit over my head.<br>
><br>
> The problem is that it does not seem to traverse the entire sys.path to<br>
> find multiple foo packages.<br>
<br>
</span>Does every foo.x package specify namespace_packages=['foo']?<br>
<br>
Do they all ship an identical foo/__init__.py with<br>
<br>
    import pkg_resources<br>
    pkg_resources.declare_namespace(__name__)<br>
<br>
?<br>
<br>
AFAIU you need both things in every package, if you want to use<br>
namespace packages.<br>
<div><div><br>
> If I do not specify namespace_packages and instead just use the<br>
> pkgutil.extend_path, then this seems to allow the packages to be in<br>
> multiple places in the sys.path.<br>
><br>
> Is there something additional for the namespace_package that i need to<br>
> specify in order for all of the sys.path to be checked?<br>
><br>
> I'm using 18.5 setuptools....but I am not sure if this somehow ties in to<br>
> wheel/pip, since I'm using that for the actual install.<br>
<br>
</div></div><span><font color="#888888">Marius Gedminas<br>
--<br>
Give a man a computer program and you give him a headache, but teach him to<br>
program computers and you give him the power to create headaches for others for<br>
the rest of his life...<br>
        -- R. B. Forest<br>
</font></span><br></div></div>_______________________________________________<br>
Distutils-SIG maillist  -  <a href="mailto:Distutils-SIG@python.org" target="_blank">Distutils-SIG@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/distutils-sig" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/distutils-sig</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>