Deprecate import of Commands directly from speech module in favour of speech.commands#12126
Conversation
See test results for failed build of commit 03ac978eab |
feerrenrut
approved these changes
Mar 11, 2021
feerrenrut
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Nice use of sed!
7 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Link to issue number:
Implements deprecation announced in: #11049, #10371, #10885
Part of: #12123
Summary of the issue:
Commands from the module
speech.commandswere being imported asfrom .commands import *inspeech\__init__.pyandspeech\manager.py.As a result, commands were often being imported as
import speech; speech.ExampleCommand()orimport speech.manager; speech.manager.ExampleCommand().Description of how this pull request fixes the issue:
The deprecated behaviour is removed and commands must be imported explicitly as
from speech.commands import ExampleCommandTesting strategy:
Check code correctness by the following process. Do the following using an unchanged repository based on the latest master commit (db664be), so code can be compared properly.
Using git bash tools find & sed (may be also included in Windows Subsystem Linux)
[a-zA-Z_][a-zA-Z0-9_]*is the regex for valid python variable name prefixesDo the following to confirm commands aren't being imported directly from speech or speech.manager
Compare the current code to this branch: nvda/dep-11049, note the only changes are:
Known issues with pull request:
None
Change log entry:
Dev Changes
Code Review Checklist: