Skip to content

Gst more fixes#258

Merged
lovetox merged 11 commits intopygobject:masterfrom
xclaesse:gst-more-fixes
Feb 15, 2026
Merged

Gst more fixes#258
lovetox merged 11 commits intopygobject:masterfrom
xclaesse:gst-more-fixes

Conversation

@xclaesse
Copy link
Contributor

No description provided.

@xclaesse
Copy link
Contributor Author

xclaesse commented Jan 12, 2026

Hm, 0d14343 causes a regression in GLib.Idle. It correctly removes all methods from that object but it wrongly inherit from GObject.GBoxed instead of the override Source object. The reason is the generator assumes override classes are direct subclass of GI classes, and not sub-subclass.

@xclaesse
Copy link
Contributor Author

Hm, 0d14343 causes a regression in GLib.Idle.

Fixed. Now GLib.Idle and GLib.Timeout inherit from GLib.Source instead of duplicating all GLib.Source attributes.

@xclaesse
Copy link
Contributor Author

@lovetox FYI, I'm also adding typing annotations to glib/gobject overrides: https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/506.

@xclaesse
Copy link
Contributor Author

Let's put this on hold, I found an issue that I described in https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/506#note_2652436.

@lovetox your optinion on that would be appreciated.

@xclaesse xclaesse force-pushed the gst-more-fixes branch 3 times, most recently from ff9a10f to 77245ec Compare January 21, 2026 13:14
@xclaesse
Copy link
Contributor Author

Ok, problem solved and typing annotation has been merged in pygobject glib/gobject overrides. This MR is ready to go.

mypy complains when it has __enter__ but not __exit__.
We should have stubs only for attributes in the current class and not
those inherited by base classes.
This is similar to constants, but are type hints for attributes
usually defined in __init__():

```
class Foo:
  attr: int
  def __init__(self):
    self.attr = 42
```
It is defined by GI for GBoxed types, and can also be defined in
overrides.
@xclaesse
Copy link
Contributor Author

xclaesse commented Feb 5, 2026

@lovetox pygobject 3.55.3 has been released with my fix for bool|None return value for source callbacks. I updated stubs in this MR.

gpointer (void*) arguments are currently typed as
`typing.Optional[None]`. They probably should be `bytes|None` but
pygobject is completely broken and those methods are unusable.
@xclaesse
Copy link
Contributor Author

@lovetox kind reminder to review this PR :)

We automatically generate an __init__ stub based on all writable
properties. This avoid duplicated __init__ definition when overrides has
e.g. `def __init__(self, *args, **kwargs)`
@lovetox
Copy link
Collaborator

lovetox commented Feb 15, 2026

Thanks, great work !

@lovetox lovetox merged commit 2ae4b7f into pygobject:master Feb 15, 2026
2 checks passed
@xclaesse xclaesse deleted the gst-more-fixes branch February 15, 2026 15:45
@xclaesse
Copy link
Contributor Author

@lovetox Thanks, are you planning publishing a release soon? This was the final fixes I needed to get my GStreamer project fully typed :)

@lovetox
Copy link
Collaborator

lovetox commented Feb 15, 2026

@lovetox Thanks, are you planning publishing a release soon? This was the final fixes I needed to get my GStreamer project fully typed :)

hm, as we merged now the Generic ListModel stuff we need to wait until PyGObject makes a stable release, otherwise we depend with a release on a dev version of PyGObject.

@xclaesse
Copy link
Contributor Author

@lovetox I'm not sure which fix is needed in pygobject, 3.55.3 release is up to date with main branch.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants