[Distutils] Easy install, making "Traditional" PYTHONPATH-based Installation work better

Jim Fulton jim at zope.com
Sun Feb 5 16:52:23 CET 2006

I'be been learning about setuptools and eggs and am very pleased.
There is one area where I'd like to see a small tweak.



four options are presented for installing outside of Python installation.

Naturally, I prefer the the last option, which the documentation recommends
against. :)  Here's why. An important use case to me is the ability for
a developer to work in a development sandbox without affecting anything
outside the sandbox.  The solution needs to be cross platform.  The
"Administrator Installation" option doesn't work for me because it requires
modifying the Python setup.  Neither the "Mac OS X "User" Installation"
nor the 'Creating a "Virtual" Python' options work for me because they
are not cross platform.  I also find the "Virtual Python" approach a bit
heavy handed.

In playing a bit, I find the "Traditional" PYTHONPATH-based Installation
works pretty well except for the problem of having to set the path manually
when invoking scripts.  This problem could be addressed by having
the generated scripts include the custom path settings.  I recommend adding
two new options to the easy_install section of the configuration file:

    A list of paths, separated by commas to be added to sys.path
    by generated scripts.

    A list of pth files, separated by commas to be added be processed
    by script files.

Generated scripts would include code to manipulate sys.path based on
this information.  So, for example, in a workspace with a 'lib' directory
containing eggs, I'd have:

   site_dirs = '/here/lib'
   script_path = '/here/lib'
   script_pth_files = '/here/lib/easy-install.pth'

The script_pth_files option is needed, I think, to avoid hardcoding the
setuptools egg path in the generated scripts.

Note that it could be argued that the site_dirs option should
be enough and that generated scripts should simply reflect this


For now, I can create a wrapper around easy_install that does
custom script generation, which could serve as a prototype for the
proposed change.


Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org

More information about the Distutils-SIG mailing list