Skip to content

Remove deprecated pygtkcompat dependency from livedemo.py#442

Merged
dhdaines merged 1 commit intomainfrom
fix-pygtkcompat-dependency-clean
Oct 23, 2025
Merged

Remove deprecated pygtkcompat dependency from livedemo.py#442
dhdaines merged 1 commit intomainfrom
fix-pygtkcompat-dependency-clean

Conversation

@lenzo-ka
Copy link
Contributor

Description

Fixes #440 - Remove deprecated pygtkcompat dependency from gst/livedemo.py

As reported in Debian bug #1118277, the gst/livedemo.py file relies on pygtkcompat, which was removed after PyGObject 3.50.x series.

Changes Made

  • Remove pygtkcompat import and enable calls
  • Add gi.require_version('Gtk', '3.0') requirement
  • Update GTK API calls to use Gtk.* instead of gtk.*
  • Update wrap mode constant to Gtk.WrapMode.WORD
  • Update main loop call to Gtk.main()

Verification Steps

  • Syntax check passes: python3 -m py_compile gst/livedemo.py
  • Imports work with modern PyGObject: python3 -c "import gi; gi.require_version('Gst', '1.0'); gi.require_version('Gtk', '3.0'); from gi.repository import GObject, Gst, Gtk; print('PyGObject dependencies available')"
  • No more pygtkcompat dependency errors

The changes are minimal and maintain full functionality while removing the deprecated dependency.

Replace pygtkcompat with modern PyGObject 3.x API to fix compatibility
with current PyGObject versions. The pygtkcompat module was removed
after PyGObject 3.50.x series and is no longer available.

Changes:
- Remove pygtkcompat import and enable calls
- Add gi.require_version('Gtk', '3.0') requirement
- Update GTK API calls to use Gtk.* instead of gtk.*
- Update wrap mode constant to Gtk.WrapMode.WORD
- Update main loop call to Gtk.main()

Fixes Debian bug #1118277
@lenzo-ka lenzo-ka requested a review from dhdaines October 23, 2025 18:28
Copy link
Contributor

@dhdaines dhdaines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm! I don't think I wrote this code, or if I did I don't have any memory of it. Seems highly unlikely that anyone would need to support an old version of GTK at this point.

@dhdaines dhdaines merged commit 4f80b87 into main Oct 23, 2025
21 checks passed
@dhdaines dhdaines deleted the fix-pygtkcompat-dependency-clean branch October 23, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Should migrate off pygtkcompat

2 participants