Mark globalVars for deprecation#14050
Conversation
feerrenrut
left a comment
There was a problem hiding this comment.
Generally looks good.
Are there any removed attributes from globalVars.py, it looks like runningAsSource was removed. Can you confirm in the description the removed attributes, and why it is ok (I assume runningAsSource was added in this release? If so a link to the PR that added it would help also.)
See also #14050 Summary of the issue: #14037 was closed because there was no way to preserve backwards compatibility. This is the case for any module level variable which the NVDA API expects to support assignment. Description of user facing changes None Description of development approach Documentation has been added: to warn developers about writing code which allows for future changes without breaking backwards compatibility. keep track of cases which we cannot safely retain backwards compatibility, so that we can clearly define when API breaking changes are necessary
|
See test results for failed build of commit 52a1c6eed4 |
See test results for failed build of commit c197318d3b |
See test results for failed build of commit 4c6564a0ea |
See test results for failed build of commit 4206bf2207 |
#14050 introduced a usage of api to core.main to beta\n#14301 moved the api import from core.main as it was otherwise unused on rc
Summary of the issue: #14301 moved an api import from core.main as it was otherwise unused #14050 introduced a usage of api to core.main to beta This means that api was used without being imported on beta and master. Description of user facing changes None Description of development approach Fix import error
|
@seanbudd, @feerrenrut , why isn't there any change log item regarding these deprecations? If add-on authors are meant not to use these variables, it's a pity that this deprecation has not been advertised. Unfortunately, the translation period is over for 2022.4. There are various options:
Fortunately, it's only a matter of deprecation, not of removal. What do you think? |
|
Let me express my opinion as one of the translators.
I have translated the changes and User guide to languages I maintain for the translation strings freeze which has ended, and I have added one of the last-minute changes, which should be included.
In conclusion, I recommend opening up one week window for the new translation strings freeze to have this translated to the communities which have developers active, and who rely on translated developer changelogs.
This doesn’t apply to polish and Croatian languages.
|
|
I don't think it is too late for 2022.4. We can reannounce the translation freeze. |
|
Announcing this was avoided, as there is currently no clear alternative for many of these variables in NVDA core. |
OK thanks for this clarification. At the beginning, I found a bit confusing the fact that there is a deprecation string below each variable. But it's true that the strategy described on top of the module is clear and your last comment is a double confirmation. It will be enough to indicate the deprecation in the change log when a deprecation warning at module level is implemented. |
Link to issue number:
Supersedes #14037
See also #14049
Summary of the issue:
#14037 was closed because there was no way to preserve backwards compatibility.
This is the case for any module level variable which the NVDA API expects to support assignment (see also #14049).
globalVarscontains many NVDA state variables which should not be changed by add-on authors.As a result,
globalVarsshould eventually be deprecated, in favour of encapsulation of these variables.This will make retaining backwards compatibility possible in the future.
Description of user facing changes
None
Description of development approach
Added a deprecation warning and strategy to the docstring of
globalVars.Encapsulated some less used
globalVarsto provide an example of what the future API should look like.runningAsSourcewas moved fromglobalVarsas this is an unreleased variable. (#14015)_allowDeprecatedAPIwas moved as it is internal code.Testing strategy:
None
Known issues with pull request:
None
Change log entries:
None
Code Review Checklist: