More time on distutils/setuptools than ctypes issues (Just a thought that struck me...)

There are two major changes in PyOpenGL 3.x (and OpenGLContext). The first is the big, obvious one, the switch to using ctypes. When it comes right down to it, other than tracking down a few AMD64 issues at the start, and a few problems between the chair and the keyboard, ctypes has "just worked" most of the time and been a very positive choice.

For instance, it's possible (as we discovered this week) to get around an older system GLU version on WinXP by redirecting the ctypes wrappers to a different DLL... that just wouldn't have been possible without having the user rebuild the library with PyOpenGL 2.x. There have been a number of those "cool" moments with the ctypes stuff, and behind it all is the fact that all of the compilation and porting work is being done by someone else (Thomas).

The second change was the attempt to eliminate the extremely customised distutils scripts in favour of a "standard" mechanism (setuptools/eggs). This was supposed to be a similarly slam-dunk operation, replace the highly customised code with the stuff everyone else uses and voila, no more portability/installation issues.

Except that .eggs aren't actually mainstream enough (apparently) to be supported by all the tools, and setuptools (or my limited understanding of it, more likely) doesn't seem to be able to (easily) specify dependencies with the kind of complexity you see in OpenGLContext... or maybe I'm just frustrated right now and there really aren't any problems.

However, I am frustrated and I'm going to stop working on this now. I'm going to play a few games of AoE II with Soni and head off to bed.


  1. Phillip J. Eby

    Phillip J. Eby on 02/10/2007 11:42 p.m. #

    In the general case, wrapping C libraries from Python (especially big C libraries) is a hard problem.<br />
    <br />
    As far as I know, every major wrapping of such libraries (wxPython, Numeric/numpy/numarray, PyGame, etc.) has its own hyper-customized distutils extensions.<br />
    <br />
    setuptools 0.7 will eventually make some of this easier, as it grows more flexibility in specifying options, including or omitting extensions, building shared libraries, sharing libraries across eggs, etc. But there's a LOT of work still to be done before we get to that point.

Comments are closed.


Pingbacks are closed.