Jeff Whitaker wrote: > Darren Dale wrote: >> On Wednesday 09 January 2008 7:01:14 pm Jeff Whitaker wrote: >> >>> Andrew Straw wrote: >>> >>>> As the author of the only other known MPL toolkit (at least in the MPL >>>> tree), I'm happy with the idea of using a namespace package for >>>> mpl_toolkits. I understand your proposal to mean that each toolkit >>>> would >>>> have a directory structure: >>>> >>>> setup.py >>>> lib/ >>>> mpl_toolkits/ >>>> __init__.py (empty) >>>> basemap/ >>>> __init__.py >>>> other_files.py >>>> >>>> This is OK with me, but I question is whether it's necessary to >>>> have the >>>> "lib" directory -- it seems entirely redundant. I'm fine with either >>>> way, though. >>>> >>>> -Andrew >>>> >>> Andrew: Yes, that's it, except that all the __init__.py files must be >>> empty, not just the first one. >>> >> >> Just to clarify, all __init__.pys must be empty? I have no experience >> with setuptools, but the way I read the documentation, it sounded >> like only the __init__.py in the namespace package needed to be >> empty, like Andrew showed. >> >> Hopefully not muddying the waters, >> Darren >> > Darren: I was assuming they both needed to be namespace packages > (mpl_tookits and mpl_toolkits.basemap). > I just went back and re-read it, and now I'm just not sure ... > The waters are muddy. I dealt with this recently in my as-yet-to-be-really-announced set of packages for realtime image analysis: motmot, at http://code.astraw.com/projects/motmot
I'm reasonably certain that Darren is correct -- __init__.py only needs to be empty if the package is a namespace package. In other words, if you wanted to have additional packages in the mpl_toolkits.basemap namespace, mpl_toolkits/basemap/__init__.py would have to be empty. If you don't see anything else in that namespace, you can keep __init__.py containing whatever it does. Note that for 2nd level namespace packages to work at all, you need the most recent setuptools (0.6c7), as a bug was recently discovered by the Enthought Tool Suite folks regarding this feature. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel