[Distutils] setup.py develop un-egg-spected result

Phillip J. Eby pje at telecommunity.com
Tue Mar 25 17:42:35 CET 2008

At 12:07 PM 3/25/2008 -0400, Oliver Schoenborn wrote:
>Quoting "Phillip J. Eby" <pje at telecommunity.com>:
>>At 10:39 AM 3/25/2008 -0400, Oliver Schoenborn wrote:
>>>I have a problem with "setup.py develop" installation.
>>This use of package_dir is not compatible with 'develop'.  For
>>'develop' to work on a project, you may not have any non-empty keys in
>>package_dir.  If you want to use develop with this project, you will
>>have to alter your directory layout so that 'core' is under 'extern',
>>or else move the 'extern' modules out of 'extern' and up to the
>>top-level directory, and update (or get rid of) package_dir accordingly.
>Thanks for your quick reply. That's a pitty, would it be difficult to
>patch? E.g. from a list of all 'values' in the package_dir then add a
>line to easy-install.pth:
># pseudo code:
>dirs = [os.path.join(os.getcwd(), dd) for key, dd
>         in package_dir.iteritems() if key.find('.') < 0]
>for dd in dirs:
>     easyinst_pth.write(dd+'\n')

That won't work correctly with respect to linking the package's 
.egg-info to its import path, and of course, uninstall still has to 
be handled.  Implementing uninstall would be further complicated by 
the possibility of package_dir having been changed between the 
install and subsequent uninstall, or any intervening re-install.

In short, it'd be a serious pain, and I haven't see any use cases for 
doing anything with package_dir besides defining a root location for 
packages (e.g. a src/ or lib/ directory).  I have no idea why the 
ability to do that was added to distutils in the first place, and if 
I ever did a full distutils replacement, it'd likely be one of the 
very first things lined up against the wall and shot.  ;-)

More information about the Distutils-SIG mailing list