Extend the life of deprecated aliases#13791
Conversation
See test results for failed build of commit 70f38a5108 |
feerrenrut
left a comment
There was a problem hiding this comment.
Looks good, assuming you've tested that these new warning show in the log correctly.
Please also update the description to note that warnings will be logged for usage of deprecations.
|
I can confirm the testing of warning logs. |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@seanbudd, I know that this PR has already been merged. |
|
I believe this was investigated when the constants were first deprecated in #12510. |
Link to issue number:
None
Summary of the issue:
For deprecated aliases, there is no need to remove them, as they have a minimum maintenance burden.
Add-on authors and contributors have requested we keep aliases where possible.
However, without marking code for removal, it can be hard to find deprecations.
Core contributors and add-on authors may want to avoid deprecated APIs.
As such, a way to test the deprecated API being removed is needed.
Description of how this pull request fixes the issue:
Extends the life of all currently deprecated aliases.
Warnings will be logged when attempting to use deprecated aliases (except for controlTypes, due to the noise of this).
Adds a global variable to mark code as deprecated, which allows developers to test NVDA with deprecated APIs removed.
As a result, there is currently no API breakages staged for 2023.1
Testing strategy:
Manual testing:
Test Steps 1:
import appModules.calculatorappfrom gui import quit; quit()(calling quit should trigger the log warning)from appModuleHandler import NVDAProcessIDfrom easeOfAccess import ROOT_KEYTest Steps 2:
globalVars._allowDeprecatedAPI = FalseModuleNotFoundError/ImportError:import appModules.calculatorappfrom gui import quitfrom appModuleHandler import NVDAProcessIDfrom easeOfAccess import ROOT_KEYKnown issues with pull request:
None
Change log entries:
Included in PR
Code Review Checklist: