[Python-3000] New Import Behavior
Phillip J. Eby
pje at telecommunity.com
Mon Jan 15 18:52:55 CET 2007
At 05:17 PM 1/15/2007 +0000, Armin Ronacher wrote:
>Hossa,
>
>I like the python import system but it's limited at some point. Imagine
>you have
>a large application with a plugin system and you want plugins to appear below
>`applicationname.plugins` (Me and the pocoo team encountered that issue some
>time ago when working on the pocoo component architecture).
>
>Imagine the following package structure::
>
> yourapp/
> plugins/
> plugin1/
> __init__.py
> foo.py
> plugin2.py
>
>And additional this one:
>
> thirdparty/
> yourapp/
> plugins/
> plugin3.py
There are two existing solutions for this problem: the pkgutil module
(available since Python 2.3, and updated in 2.5 to support zipped packages
as well), and setuptools. Setuptools in fact has *multiple* solutions for
this problem, and only one of them requires you to set up such elaborate
structures in the first place.
If you will kindly re-raise the issue on the distutils-sig, I will
elaborate further there, as this is off-topic for the Python 3000 list.
More information about the Python-3000
mailing list