sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
950 stars 405 forks source link

Type conflict between base `tools.jobs.Scheduler` class and `plugins.jobs.Scheduler` subclass #2476

Open dgw opened 1 year ago

dgw commented 1 year ago

Raised in #2471. Band-aided with a type: ignore[assignment] comment, but we should really redesign this part of the API.

@Exirel pointed out that Sopel doesn't really need a non-plugin job scheduler any more, since it can just use the asyncio event loop now. Since tools.jobs is already documented as internal tools that plugin developers shouldn't use, any reason we shouldn't just drop the tools.jobs module and move the still-useful parts into plugins.jobs?

(tools.jobs says "As of Sopel 5.3, this is an internal tool […]", so that's several years of warning that plugin authors shouldn't use it. The Scheduler class also used to be a JobScheduler before some refactoring years ago, so code that tries to use the even older version that wasn't explicitly documented as being internal will fail.)