So, I started experimenting with setting up an alternate location for
installing files. Using FreeBSD, all libraries go into
/usr/local/lib/pythonX.Y/site-packages by default (no
/usr/lib/pythonX.Y). That includes packages installed by ports
(FreeBSD's packaging system).
But we're creating an alternate hierarchy for our systems, and I've
started thinking this should include multi-version software
installation (things installed through a packaging system will still
go wherever the packager wants them to go). Eggs don't map
terribly well to most packaging systems, as packaging systems don't
support multiple versions and "active" versions of software well.
Eggs do support these things, and moreso these features are really
important to the way we deploy software.
So it wasn't too hard... first, I made
/usr/local/lib/python2.4/site-packages/sitecustomize.py, that
looks like:
import site
import sys
site.addsitedir("/iscape/lib/python%s.%s/site-packages"
% (sys.version_info[0], sys.version_info[1]))
Then I created a file
/usr/local/lib/python2.4/distutils/distutils.cfg:
[install]
prefix = /iscape
[easy_install]
find_links = http://host.name/package_archive/
http://pythonpaste.org/package_index.html
install_dir = /iscape/lib/python%(version)s/site-packages
site_dirs = /iscape/lib/python%(version)s/site-packages
Substituting %(version)s with the respective Python version, of
course (though we're primarily using 2.4, especially for our own
software).
Now I can install our internal packages to a directory
/package_archive/ (and just let Apache create the HTML index of
that directory), and easy_install.py PackageName will install into
/iscape/lib/.
Especially until such time as easy_install.py (or probably
another to-be-written tool called nest) does package management
(listing and deleting installed versions of software) this will keep
all our eggs together and easy to manage.