[Debian-med-packaging] Bug#936681: gwyddion: Python2 removal in sid/bullseye

Yavor Doganov yavor at gnu.org
Wed Nov 20 10:20:38 GMT 2019


On Sun, Sep 29, 2019 at 08:27:59PM +0100, Shayan Doust wrote:
> Just a notice to those who read this: it seems like with the python2 ->
> python3 migration, python-gtk2-dev becomes redundant and should be avoided.

It's more complex than that.  PyGTK is strictly tied to Python 2 and
GTK 2.  To move to Python 3, one must use the dynamic bindings (PyGI,
based on gobject-introspection) but OTOH introspection _officially_
only works with GTK 3.

I have ported a GTK 2 package from PyGTK to PyGI, see planner [1].
However, as the patch description says, it's basically a hack that
works by chance.  I only tested with a simple example script; it's
quite possible that some of the exposed APIs may fail miserably.  And
there's a big fat warning when you start it:

| $ planner 
| /usr/lib/python3/dist-packages/gi/overrides/Gtk.py:55: RuntimeWarning:
| You have imported the Gtk 2.0 module.  Because Gtk 2.0 was not
| designed for use with introspection some of the interfaces and API
| will fail.  As such this is not supported by the pygobject development
| team and we encourage you to port your app to Gtk 3 or greater. PyGTK
| is the recomended python module to use with Gtk 2.0

If you are comfortable with Python (I'm not) you could try and do the
same with gwyddion.  However, it is certain that such patch will be
rejected upstream because it will break user scripts.

The only viable, long-term solution is to port the whole thing to GTK
3.  I'd be willing to do that but it appears that upstream will reject
the patch anyway, so it's a lost cause.  We could still use this patch
in Debian but it will be a nightmare to update it when merging new
upstream releases and it may spoil the relationship with upstream, as
the gwyddion APIs that Debian will provide will be incompatible with
the rest of the world.

IMO the only chance to keep gwyddion in bullseye is to build it with
the option --disable-pygwy.  This will automatically solve #936681,
#942902 and #911167 (gtksourceview2 is used only for syntax
highlighting in the python console).  At least for the time being it
will give us a releasable but less capable version of the package
which is still better than no package at all.

When GTK 4 is out, most probably the Debian GNOME team will start an
effort to remove GTK 2 as I don't think they'd be happy to maintain 3
library versions.  Then gwyddion would be at risk of being removed as
well, in case upstream are still unwilling to move away from GTK 2.

[1] https://sources.debian.org/src/planner/0.14.6-8/debian/patches/python3.patch



More information about the Debian-med-packaging mailing list