[pygtk] dsextra.py installed with PyGTK 2.4.1 binaries (windows)

Cedric Gustin cedric.gustin at swing.be
Thu Mar 3 15:39:06 WST 2005


Hi Stéphane,

Stéphane Brunet wrote:

> I am trying to build and install PyGTKGLext for Windows with Python 2.4
> and PyGTK 2.4.1.
> The build process was successful but the install one failed. I get the
> following error :
> 
> C:\msys\1.0\home\Stephane\pygtkglext-1.0.1>setup.py build
> --compiler=mingw32 install
> running build
> running build_py
> running build_ext
> using MinGW GCC version 3.4.2 with -mms-bitfields option
> running install
> running install_lib
> Traceback (most recent call last):
> File "C:\msys\1.0\home\Stephane\pygtkglext-1.0.1\setup.py", line 158, in ?
>   cmdclass={'install_lib': PyGtkGLExtInstallLib,
> File "C:\Python24\lib\distutils\core.py", line 149, in setup
>   dist.run_commands()
> File "C:\Python24\lib\distutils\dist.py", line 946, in run_commands
>   self.run_command(cmd)
> File "C:\Python24\lib\distutils\dist.py", line 966, in run_command
>   cmd_obj.run()
> File "C:\Python24\lib\distutils\command\install.py", line 505, in run
>   self.run_command(cmd_name)
> File "C:\Python24\lib\distutils\cmd.py", line 333, in run_command
>   self.distribution.run_command(command)
> File "C:\Python24\lib\distutils\dist.py", line 966, in run_command
>   cmd_obj.run()
> File "C:\msys\1.0\home\Stephane\pygtkglext-1.0.1\setup.py", line 61, in run
>   self.add_template_option('VERSION', VERSION)
> File "C:\Python24\lib\distutils\cmd.py", line 112, in __getattr__
>   raise AttributeError, attr
> AttributeError: add_template_option
> 
> After investigating, I remarked that dsextra.py installed in
> C:\Python24\Lib\site-packages\gtk-2.0 is different than the one provided
> in the pygtk-2.4.1 source package. Indeed, it contains the definition of
> InstallData class which is more recent than the 2.4.1 version, according
> to the pygtk CVS. And the InstallLib class has no add_template_option()
> method any more (that's why there's an error...). But after looking at
> this file, I found that it is also different to the next CVS one...

Right, dsextra.py was changed a few weeks ago in CVS HEAD. In order ro
use some new functionalities of the dsextra.InstallData class, I built
my pygtk-2.4.1 binaries with this new dsextra.py. An unfortunate side
effect is this patched dsextra.py gets installed and breaks the setup.py
script for thrird party libraries, pygtkglext in particular. Sorry about
that ! I didn't know it would break "distutils" compatibility for
pygtkglext.

So, you have three options :

1. Overwrite C:\Python24\Lib\site-packages\gtk-2.0\dsextra.py with the
one from the pygtk-2.4.1 official tarball
2. Rebuild pygtk-2.4.1 from the official tar.gz, and install it.
Alternatively, I could also post an updated pygtk-2.4.1 installer, where
I revert to the old dsextra.py.
3. Modify the pgtkglext setup.py file to cope with the CVS HEAD changes
to dsextra.py. See the pygtk setup.py for details. Basically, you want
to add 'install_data': PyGtkInstallData to the cmdclass dictionary, and
  move the calls to add_template_option to a class derived from InstallData.

> So I am completely messed up but I still want to update the setup.py of
> PyGTKGLext package in order to get a working binary installer for
> Windows. How shoud I use the new InstallData class ? Which version of
> dsextra shoud I refer to ?

You should not have to update your setup.py script, except if you want
to use the InstallData class (derived from distutils.install_data). In
the meantime, I strongly recommend option 1, as I will soon come up with
a fix that re-enables add_template_option in InstallLib.

> FYI, I used the already-build pkgtk binary installer for windows.

I will post updated installers ASAP.

Cedric


More information about the pygtk mailing list