A lesson from years of PyOpenGL (Not quite Zen, but oh well...)
Written by
on
in
Snaking.
I took over managing the PyOpenGL project a very long time ago. Over that period it's had a complete rewrite (two if you count OpenGL-ctypes) and has dramatically grown in complexity. However, for the most part it has "just worked"... once you got it installed.
Over the years, however, we've been dogged by extensive problems with the installation mechanisms, particularly related to the Togl package, but also with the highly-customised disutils SWIG wrapper support.
Which is what brings me to this simple lesson:
Distribution issues count.
If at all possible, include everything in the box (e.g. include the SWIG-generated files so that your users don't need SWIG). If a component is problematic to build, leave it out and make it a separate package that people can avoid (e.g. Togl, as it should be done). Provide packages that automate the entire process where possible (here I've often fallen down for PyOpenGL on Linux distributions, but the distributions have been very good about doing the packaging themselves).
I spent much of this afternoon wrestling with a piece of proprietary software that just doesn't get it. Just to get a working basic install requires creating complex apache directives, checking out half a dozen CVS projects, building a custom tool for processing the source files, building half a dozen custom postgresql extensions, manually setting up a large and complex directory structure, creating symlinks in dozens of locations to files in other locations, and manually creating 8 or nine interlinked database records. Sure, it only needs to be done once per machine, that will then run for years, but that's hundreds of dollars of billable time wasted for every machine you need to build.
I've burned many, many hours on this setup for what should have been a matter of checking out the code, running some script to do the database setup, setting up apache to point to it and then starting up the server. I still don't have a working installation, btw; I've got enough to do some basic operations, but there's obviously still significant missing pieces that I've omitted from the setup.
In OpenGL-ctypes I'm trying to make the system bog-simple to install. It will be an egg, installed via a standard setuptools installation. Any exotic dependencies (Togl, non-system GLE and the like) will be separate eggs. Still, yesterday it took me 5 minutes just to get setuptools installed properly as a non-admin (hint: had to setup a .pydistutils.cfg file). That rather diminishes the simplicity of the install. Will have to work on that. What I really want to do is to get the entire install down to:
easy_install OpenGLContext
but to make that work getting easy_install installed (even if you're not an admin) has to be made foolproof. So I'll likely need to produce a custom ez_setup script that's coded defensively to make sure the setup runs to completion... though I'd hoped to avoid custom setup code.
Comments
Comments are closed.
Pingbacks
Pingbacks are closed.
Matt on 10/12/2006 7:44 a.m. #
Didn't completely understand your easy_install problem but just in case you didn't know, non-admin users can setup a virtual python install in their home directory. <br />
<br />
It shouldn't be the developer's responsibility to make sure a non-admin user has a proper environment for installing eggs.<br />
<br />
easy_install installation options: <br />
http://peak.telecommunity.com/DevCenter/EasyInstall#custom-installation-locations<br />
<br />
(Sorry if I misunderstood your post.)
T.J. Jankun-Kelly on 10/12/2006 2:40 p.m. #
Do we have an ETA on PyOGL-ctypes? I have not been able to find a definitive answer recently, and since PyOGL will not build on recent MacBook Pros, I'm hoping PyOGL will help this (along with easier extension access).<br />
Mike Fletcher on 10/13/2006 8:25 a.m. #
Matt: yes, I'm aware of the ability to set up a non-admin installation, the problem is that it took me long minutes of messing about and googling for solutions (and I understand Python's import hooks and the rest fairly well).<br />
<br />
What I'm intending is to alter ez_setup so that it warns the user about the problem and offers to fix it (by creating a .pydistutils.cfg if it doesn't exist, or at least mentioning precisely where to go for instructions). Trying to install setuptools, not mentioning any failure, then bombing out later when trying to *use* setuptools is not going to make people love the system.
Mike Fletcher on 10/13/2006 8:28 a.m. #
T.J.: We are currently planning to do our initial packaged alpha release of OpenGL-ctypes on Sunday. That should work on OS X (thanks to Josh), Linux and Win32, with some bits missing on each platform.