After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754491 - Don't emit require_version warning if namespace was loaded previously using g_irepository_require
Don't emit require_version warning if namespace was loaded previously using g...
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-02 21:18 UTC by Christoph Reiter (lazka)
Modified: 2015-09-22 21:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
on't emit require_version warning if namespace was loaded previously using g_irepository_require (8.43 KB, patch)
2015-09-06 03:45 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2015-09-02 21:18:36 UTC
Reminder for me.

Garrett mentioned on IRC that this introduces unnecessary warnings with Gedit plugins as some namespaces are loaded in C there: https://git.gnome.org/browse/gedit/tree/gedit/gedit-plugins-engine.c#n63

The current warning code doesn't take this into account and only hides warnings for dependencies if a namespace gets loaded through a Python import.
Comment 2 Christoph Reiter (lazka) 2015-09-06 03:45:53 UTC
Created attachment 310730 [details] [review]
on't emit require_version warning if namespace was loaded previously using g_irepository_require

Instead of tracking loaded dependencies ourself to hide warnings if they
were loaded by a previous import just look if the namespace was loaded
before the import. This (a) makes the implementation much simpler and
(b) also takes into account namespaces loaded outside of Python/PyGObject
using the libgirepository C API (as is common in applications using
libpeas with Python plugins)

This also introduces a new Python wrapper for g_irepository_is_registered()
to allow checking the loading state of namespaces before imports.

This fixes unnecessary require_version warnings in gedit, gnome-builder,
totem, rhythmbox etc.
Comment 3 Garrett Regier 2015-09-22 21:48:23 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.