[Distutils] PEP 376 - site-directories and site.addsitedir

P.J. Eby pje at telecommunity.com
Fri May 15 00:48:11 CEST 2009

At 11:38 PM 5/14/2009 +0200, Tarek Ziadé wrote:
>That happened because I got a bit lost in the way finders were working
>in setuptools, which seemed
>a bit over-engineered at that time to me (but I might end up changing
>my mind at sime point when I understand it better).

The finders mechanism is there to allow support for arbitrary PEP 302 
importers -- i.e., sys.path strings that don't go to the filesystem.

The main reason why there are two finders currently (find_on_path and 
find_in_zip) is that find_in_zip supports egg directory 
bundling.  That is, an .egg zipfile may contain arbitrarily nested 
.egg directories, and an .egg directory may contain arbitrarily 
nested .egg directories or .egg zipfiles.

However, if you're not implementing dependency resolution, you don't 
need that support.  If such a nested item were in use, it'd be on 
sys.path already.  (In other words, the nesting lookups are only 
useful for alternate version discovery, not simple metadata lookups.)

More information about the Distutils-SIG mailing list