pygtk2 and its numpy dependency

Adam Jackson ajax at redhat.com
Mon Aug 10 19:36:26 UTC 2009


pygtk2 implements a function called gtk.gdk.get_pixels_array(), which
returns the pixel contents of a GDK pixbuf as a numpy array.  Fine and
dandy, but this means it links against numpy (7 megs) which is itself
linked against atlas (12 megs).  Kind of a lot for a single function,
especially on a live image.

Especially for a function that's basically unused!  gnome-applet-music
uses it to implement a poor-man's Porter-Duff blend, and that's the only
caller currently packaged in Fedora, at least according to package deps.
I have a patch (attached) that fixes that [1], which means we could
compile our pygtk2 without numpy support and not break anything in
Fedora proper.

However, google codesearch does turn up what look like a few other users
of that function, some of which we may actually want to ship someday.
So we've got options:

a) remove the explicit Requires: numpy from pygtk2, require apps that
actually want this function to Require it themselves

b) fake the numpy data type ABI in pygtk2 itself by cult-and-pasting it
from numpy

c) declare that get_pixels_array() just doesn't work in Fedora
(historically true, back in like FC3)

d) leave things as they are

I lean towards a).  I think b) is icky but doable, since that ABI is
effectively unbreakable anyway (inherited from the older python-numeric
module).  The other two are way lame.

Thoughts?

[1] - Readers are invited to count the wtf's in the code being replaced,
as well as in its callers.  Don't treat it as a drinking game though.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avoid-numpy.patch
Type: text/x-patch
Size: 1300 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20090810/9af68987/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20090810/9af68987/attachment.sig>


More information about the fedora-devel-list mailing list