pygtk2 and its numpy dependency

Jon Ciesla limb at jcomserv.net
Mon Aug 10 19:40:23 UTC 2009


Adam Jackson wrote:
> 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
>   
Since pygtk2 does actually use numpy, isn't d) the best (albeit most 
annoying) option?

Full disclosure:  Numpy maintainer.

-- 
in your fear, seek only peace
in your fear, seek only love

-d. bowie




More information about the fedora-devel-list mailing list