I did some work on the script I mentioned previously for setting up
environments (as an alternative to virtual-python.py. I also
moved it slightly, to http://svn.colorstudy.com/home/ianb/workingenv
It now plays nicely with Setuptools. Well, maybe that's an
exaggeration; at least the two are talking again.
Here's the way it basically works:
$ wget http://svn.colorstudy.com/home/ianb/workingenv/workingenv.py
$ python workingenv.py new-environ/
$ source new-environ/bin/activate
Now everything you do will use the libraries installed in
new-environ/ (and no other libraries!), and new libraries will be
installed into that location (until you deactivate). Any scripts
installed will go in the new-environ/bin/ directory, and (at least
if you are using Setuptools) will implicitly activate the environment
whenever they are invoked. The explicit activation should (hopefully)
only be necessary during development.
activate doesn't do anything fancy, just update $PYTHONPATH to
include new-environ/lib/python2.4. Setuptools doesn't need to be
installed (if it isn't, it will be installed for you). It should work
with Python 2.3, but probably not earlier.
I also added a notion of a requirements listing for a new environment,
basically a list of packages to be installed. Admittedly this is only
loosely related to the installation. But anyway, you can use this to
quickly set up a nice fresh environment. Since the TurboGears people
have been thinking about this some (though admittedly I haven't read
through the discussion) I threw together a couple half-assed examples
for 0.8 and 0.9. It goes like:
$ python workingenv.py -r \
http://svn.colorstudy.com/home/ianb/workingenv/tg-example.txt \
new-environ/
This reads that text file, gets requirements out of it (including a
--find-links setting), and installs everything. The advantage of
this is that the requirements listing isn't associated with any one
package. It can have highly constrained requirements (i.e., exact
versions), but this doesn't cause a cascade of changes when a single
package is updated. Also, the requirements are only checked at
installation, they aren't checked at runtime, so you can manually
install other versions for testing and development without getting
conflicts.