tools: deprecations & reorganization (feat. sopel.cli)
#2385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Started looking at
sopel.toolsas a follow-up to #2379 and noticed some more cleanup that could be done. Specifically:OutputRedirectclass is used by nothing, appears to be a relic of the 3.x-era logging system, and should be deprecated.check_pid()belongs under theclinamespace, because that's the only code that needs it. And plugins shouldn't be touching PIDs anyway.stderr()also ideally should never be used by plugins. If they really really want to print directly to a terminal instead of using a logger, they have access toimport sys; print('some bs', file=sys.stderr)on their own.get_input()is already deprecated, but I had to replace uses of it to eliminate circular imports (because I'm perhaps foolishly keeping the moved functions available intoolsuntil 8.1).Checklist
make qa(runsmake qualityandmake test)Notes
I was going to do this stuff a bit more atomically, moving things from
toolstocliin a series of several commits, but that approach ran into circular-import errors if I tried to only move one function at a time. So I'm sorry, but I couldn't find a reasonable way to break it down into smaller commits. You'll just have to review the whole thing at once. 🙏