[Distutils] separate distribution of arbitrary submodules?

Václav Šmilauer eu at doxos.eu
Fri Dec 7 17:13:26 CET 2012


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?

I tried installing A.B with its own setup.py, with 
setup(...,packages=['A.B']), it is installed in A.B-....egg, but not 
found when I want to import A.B (let alone with iter_modules).

Background of this question: a common code A is distributed to 
customers, which in addition use their specific modules (A.A, A.B, A.C, 
...); the code in A should, however, show them which modules are 
available - for user-friendliness.

Cheers, Vaclav




More information about the Distutils-SIG mailing list