<div class="gmail_quote">On Tue, May 15, 2012 at 1:26 PM, Eric V. Smith <span dir="ltr"><<a href="mailto:eric@trueblade.com" target="_blank">eric@trueblade.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm looking at fixing pkgutil.extend_path in order to support namespace<br>
packages where some portions use PEP-420 and some use extend_path.<br>
<br>
The first thing I notice is that there are no tests for<br>
pkgutil.extend_path :(<br>
<br>
extend_path currently just examines the filesystem directly, which means<br>
it doesn't support portions in zip files or other finder/loaders.<br>
<br>
But if I understand PJE and others correctly, the idea is to modify<br>
extend_path so it calls the path_hook finders instead of looking at the<br>
filesystem (in order to find the other __path__ entries). </blockquote><div><br>Well, I actually wasn't trying to support that at all; I've never used extend_path() myself, so I was only talking about implementing transitional support for the PEP in declare_namespace().<br>
<br>That being said, it sounds like adding support in extend_path() might also be worthwhile. Presumably, it would *not* auto-update, since extend_path() doesn't currently do that. (Just as declare_namespace() *should* auto-update, because it currently does.)<br>
<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This looks<br>
like a change in functionality: previously only real filesystem packages<br>
would be found. With this change it would include other finders (like<br>
zip files). While it's a change, it would align well with importlib.<br>
Personally I'm okay with this change.<br></blockquote><div><br>Makes sense to me.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There's the added issue of how to deal with .pkg files. Is only<br>
supporting them from the filesystem okay? Or is it worth the hassle of<br>
creating some finder API to access them?<br></blockquote><div><br>I don't know who actually uses them, but then I don't know who uses extend_path(), period. The only examples I was able to find with Google and Nullege are of the form "try: declare_namespace() except: extend_path()" -- that is, code that first tries to use declare_namespace() instead.<br>
</div></div><br>