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

[BREAKING CHANGE] Refactoring: Split event loop in several modules #537

Merged
merged 4 commits into from Apr 18, 2023

Conversation

penguinolog
Copy link
Collaborator

  • urwid.main_loop is split into multiple modules which is easier to maintain
  • urwid.compat is not used anymore and removed
  • TornadoEventLoop, GLibEventLoop, TwistedEventLoop and TrioEventLoop accessible ONLY if required dependencies installed (like: Tornado installed -> TornadoEventLoop is accessible for import)
  • TornadoEventLoop use the same idle logic as AsyncioLoop: tornado.ioloop.IOLoop is asyncio based.
  • Trio < 0.15 is not supported. Version 0.15 was released almost 3 years ago.
  • Tornado < 5.0 is not supported. Tornado 5.0 was released 5 years ago.
Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

* `urwid.main_loop` is split into multiple modules which is easier to maintain
* `urwid.compat` is not used anymore and removed
* `TornadoEventLoop`, `GLibEventLoop`, `TwistedEventLoop` and `TrioEventLoop`
  accessible ONLY if required dependencies installed
  (like: Tornado installed -> `TornadoEventLoop` is accessible for import)
* `TornadoEventLoop` use the same idle logic as `AsyncioLoop`:
  tornado.ioloop.IOLoop is asyncio based.
* Trio < 0.15 is not supported. Version 0.15 was released almost 3 years ago.
* Tornado < 5.0 is not supported. Tornado 5.0 was released 5 years ago.
@penguinolog penguinolog requested a review from wardi April 17, 2023 13:14
@wardi
Copy link
Collaborator

wardi commented Apr 17, 2023

What's the breaking change part of this? It looks like the __init__.py and conditional imports will remain compatible

@penguinolog
Copy link
Collaborator Author

penguinolog commented Apr 17, 2023

What's the breaking change part of this? It looks like the __init__.py and conditional imports will remain compatible

Direct import of event loop class from implementation module changed (since module splitted).
Stubs import impossible without requirements met (should not be used, but can expect anything)
self.GLib like hacks removed, probably somebody used it (weird)

* `EventLoop` should be real abstract
* add new module docstrings
@penguinolog penguinolog requested a review from wardi April 17, 2023 17:14
@penguinolog penguinolog requested a review from wardi April 18, 2023 05:39
Copy link
Collaborator

@wardi wardi left a comment

Choose a reason for hiding this comment

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

LGTM

@penguinolog penguinolog merged commit d1710f0 into urwid:master Apr 18, 2023
5 checks passed
@penguinolog penguinolog deleted the split_loops branch April 18, 2023 15:35
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.

None yet

2 participants