Skip to content

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

Merged
penguinolog merged 4 commits into
urwid:masterfrom
penguinolog:split_loops
Apr 18, 2023
Merged

penguinolog merged 4 commits into
urwid:masterfrom
penguinolog:split_loops

Conversation

@penguinolog

Copy link
Copy Markdown
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
Comment thread urwid/event_loop/abstract_loop.py Resolved
Comment thread urwid/event_loop/asyncio_loop.py Resolved
@wardi

wardi commented Apr 17, 2023

Copy link
Copy Markdown
Collaborator

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

@penguinolog

penguinolog commented Apr 17, 2023 •

Copy link
Copy Markdown
Collaborator Author

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
Comment thread urwid/event_loop/abstract_loop.py Resolved
@penguinolog
penguinolog requested a review from wardi April 18, 2023 05:39

@wardi wardi left a comment

Copy link
Copy Markdown
Collaborator

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
@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.

2 participants