On Fri, Dec 7, 2012 at 11:13 AM, Václav Šmilauer <[email protected]> wrote: > Hello, > > I am using setuptools to package module A. I would like to separately > package also modules A.* such that those submodules are discoverable (using > pkgutil.iter_modules preferrably) from within A, provided their names are > unknown to A. Can this be done with some clever __path__ manipulation > perhaps?
What you want is called a namespace package. If you declare A as a namespace package, then you can ship as many separate projects containing A.* modules, and pkgutil.iter_modules() will work on them once installed. (What you cannot do is put any code in A/__init__.py for those projects, except the code that declares it a namespace package. Please see the setuptools and pkg_resources documentation on namespace packages for more info.) _______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
