[pygtk] pygtk parallel install
James Henstridge
james@daa.com.au
Sun, 18 Aug 2002 21:37:16 +0800
I have just checked in changes to pygtk and gnome-python (both 1.2 and
2.0 branches) to make parallel install easier.
Here is a small summary of how it works:
1. each major version of pygtk (1.2, 2.0, etc) installs under:
$(prefix)/lib/python?.?/site-packages/gtk-x.y
2. each version of pygtk installs a file called pygtk.pth into:
$(prefix)/lib/python?.?/site-packages
containing a single line: gtk-x.y
3. each version of pygtk installs the file pygtk.py into
$(prefix)/lib/python?.?/site-packages
This file is identical for all pygtk versions.
Addon packages install into the appropriate gtk-x.y directory.
Results are:
a. Files for individual pygtk "platforms" are kept separate, and
prevented from being imported together.
b. sysadmins and/or distributors can decide which version of pygtk
is the default by adjusting pygtk.pth
c. Programs can request a particular major version of pygtk with:
import pygtk ; pygtk.require('x.y')
If they want a particular version, this can be followed with an
assert:
import pygtk ; pygtk.require('2.0')
import gtk
assert gtk.pygtk_version >= (1,99,12), 'pygtk version too old'
James.
--
Email: james@daa.com.au | Linux.conf.au http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.