Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace GBulb with PyGObject's native asyncio handling #2550

Merged
merged 14 commits into from
Sep 13, 2024

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented May 5, 2024

PyGObject has an in-development branch adding native asyncio integration. This PR replaces GBulb with that branch.

At this point, this is an experiment to provide testing feedback upstream; it is unlikely we'll adopt this before PyGObject merges the branch.

Refs #2548 (an alternate PR removing gbulb)

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@rmartin16
Copy link
Member

PyGObject==3.50.0 released today. Unfortunately, gbulb is not compatible with it and Gtk apps crash at launch; PyGObject is now expecting the event loop installed by gbulb to provide a running() method that implements a context manager.

I mention it here because PyGObject merged their native async support which included the change that breaks gbulb. Given this PR is intended to use that new functionality, merging this would remove gbulb and this issue with PyGObject==3.50.0.

@freakboy3742 freakboy3742 marked this pull request as ready for review September 12, 2024 22:21
@freakboy3742
Copy link
Member Author

Let's do it. I've got no love for maintaining GBulb; the fact that 3.50.0 is backwards incompatible with means there's a good reason to adopt the new API.

It's also promising that the final form of this patch needed a tweak to slow down GTK operation so that the probe can observe changes :-)

Copy link
Member

@rmartin16 rmartin16 left a comment

Choose a reason for hiding this comment

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

few questions. i'll test on fedora and arch as well to make sure nothing weird happens.

examples/handlers/handlers/app.py Outdated Show resolved Hide resolved
gtk/pyproject.toml Outdated Show resolved Hide resolved
gtk/src/toga_gtk/app.py Show resolved Hide resolved
gtk/src/toga_gtk/app.py Outdated Show resolved Hide resolved
Copy link
Member

@rmartin16 rmartin16 left a comment

Choose a reason for hiding this comment

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

Looks good. Let's send it.

@freakboy3742 freakboy3742 merged commit c1b4709 into beeware:main Sep 13, 2024
38 checks passed
@freakboy3742 freakboy3742 deleted the gio-async branch September 13, 2024 02:10
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