Fix building when Gtk doesn't support version check #1900

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@markvoorhies

This is a quick patch to fix a build problem that I ran into this morning when updating matplotlib via pyston on my Ubuntu 12 laptop. I haven't dug into this deeply, but this
is my current understanding (and the patch does fix the build problem on my laptop):

python setup.py install --user
fails with
AttributeError: 'gi.repository.Gtk' object has no attribute 'get_major_version'

for old versions of Gtk without support for introspection
(specifically, on Ubuntu 12 with python-gtk2 2.24.0-3)

This commit silently drops the associated exceptions for the two Gtk
version checks in setupext.py

@markvoorhies markvoorhies Patch for Gtk w/o introspection support
python setup.py install --user
fails with
AttributeError: 'gi.repository.Gtk' object has no attribute 'get_major_version'

for old versions of Gtk without support for introspection
(specifically, on Ubuntu 12 with python-gtk2 2.24.0-3)

This commit silently drops the associated exceptions for the two Gtk
version checks in setupext.py
627793f
Member
pelson commented Apr 12, 2013

Thanks @markvoorhies. LGTM 👍

Owner
mdboom commented Apr 13, 2013

Thanks. Something is fishy here, since its requesting gtk3, the gtk2
version shouldn't enter into it... I'Ll have a look next week.
On Apr 12, 2013 3:36 PM, "Phil Elson" notifications@github.com wrote:

Thanks @markvoorhies https://github.com/markvoorhies. LGTM [image: 👍]


Reply to this email directly or view it on GitHubhttps://github.com/matplotlib/matplotlib/pull/1900#issuecomment-16313128
.

Owner
efiring commented May 11, 2013

@markvoorhies, I suspect you don't actually have the full gtk3 dependencies installed. It works on my Ubuntu Precise VM. I suspect this is the version of Ubuntu you have. Have you installed the python-gobject package? It should pull in python-gi and python-gobject-2, and I think that is what it takes.

Owner
mdboom commented May 11, 2013

Sorry for not notating this earlier, but I think this is a duplicate of #1949. @markvoorhies: can you confirm that resolves the issue. #1949 explicitly says "I want Gtk 3 when using gobject introspection" -- it therefore should guarantee that the new version-getting API is there.

@mdboom Looks like that fixed it =)

Matplotlib 9e734b6 builds and runs while the build error reproduces for 9e477b3.

@efiring yep, the laptop is Ubuntu Precise amd64:

mvoorhie@virgil:~$ cat /etc/issue
Ubuntu 12.04.2 LTS \n \l

mvoorhie@virgil:~$ uname -a
Linux virgil 3.2.0-39-generic #62-Ubuntu SMP Thu Feb 28 00:28:53 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

mvoorhie@virgil:$ dpkg -l | grep -i gobject | grep python
ii python-gi 3.2.2-1
precise Python 2.x bindings for gobject-introspection libraries
ii python-gobject 3.2.2-1~precise Python 2.x bindings for GObject - transitional package
ii python-gobject-2 2.28.6-10ubuntu1 deprecated static Python bindings for the GObject library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment