[Distutils] More DWIMmy goodness for easy_install
Phillip J. Eby
pje at telecommunity.com
Mon Feb 13 19:49:50 CET 2006
FYI, I just checked in some additional target directory checks for
easy_install, based on an idea inspired by a comment from Exarkun on my
blog. It seems that a lot of the most recent "new" problems reported with
setuptools have to do with site-packages directories under secondary
prefixes, like Debian's /usr/local or various 64-bit distros'
/usr/lib64. EasyInstall hasn't previously been able to detect that these
are valid "site" directories, leading to unnecessary pain for users of
So, the latest SVN version now contains logic to verify the "site"-ishness
of the installation directory, via the crude (but effective) expedient of
writing a .pth file to the directory and spawning another Python process to
see if the .pth file actually gets processed. This should almost
completely eliminate the need for --site-dirs, and along with it, the need
to actually read the installation instructions. :)
In fact, the only time now that somebody should care about the "custom
installation location" docs is if they want to set up a custom "site"
directory and *not* use PYTHONPATH to do it.
In addition to this new empirical test for site-ness, I've also added
writability and existence checks, with hopefully-useful error messages. So
we should now be a lot closer to a place where package developers can feel
safe using ez_setup as part of their installation process, even if they're
very particular about the user experience on a wide variety of platforms.
However, testing is appreciated, as always. I'm particularly interested in
whether this version can correctly deal with installation targets like
/usr/lib64 and Debian's /usr/local/python2.x/site-packages directories,
*without* needing to specify site-dirs on the command line or in a config file.
More information about the Distutils-SIG