-
-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streamline importing of addon directories for python packages #14350
Merged
Conversation
This file contains 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
seanbudd
reviewed
Nov 8, 2022
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
See test results for failed build of commit 3ba0bb23c6 |
See test results for failed build of commit dcbad591cf |
I don't think these failing tests are related. |
seanbudd
approved these changes
Nov 10, 2022
Yes, looks like this was caused by #14342 |
seanbudd
pushed a commit
that referenced
this pull request
Nov 28, 2022
Fixes #14408 Summary of the issue: PR #14350 streamlined import code for globalPlugins and appModules. However, the reloading of these modules was overlooked. Description of user facing changes Reloading of appModules/globalPlugins works again Description of development approach The reloading functions for both appModules and globalPlugins call addonhandler.packaging.addDirsToPythonPackagePath
6 tasks
seanbudd
pushed a commit
that referenced
this pull request
Apr 18, 2023
Fix-up of #14350. Summary of the issue: Running NVDA 2023.1 (and older), with add-ons and/or scratchpad enabled: I get the following deprecation warnings: When opening start menu: WARNING - appModuleHandler._warnDeprecatedAliasAppModule (15:49:46.531) - MainThread (19688): Importing appModules.searchapp is deprecated, instead import appModules.searchui. When switching to Notepad++: WARNING - appModuleHandler._warnDeprecatedAliasAppModule (15:50:26.621) - MainThread (19688): Importing appModules.notepad++ is deprecated, instead import appModules.notepadPlusPlus. And if I force errors on deprecated code by modifying NVDAState._allowDeprecatedAPI to return False, I get errors instead. This is not expected since these warnings/errors come from NVDA's core code which should not (and actually does not) contain deprecated code. Description of user facing changes No more wrong deprecation warnings/errors due to NVDA's core appModules when opening start menu or switching to Notepad++ Description of development approach appModules.__path__ contains the paths where NVDA has to search appModules. It contains first the folder in the scratchpad, then the folders in add-on containing appModules and finally the core appModule folder. Thus we need to look at the last element of appModules.__path__, not the first as it was done.
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:
Closes #14340
Summary of the issue:
For addons, the several directories are added to the python package path using a function in the config module. This needs refactoring:
nvda/source/config/__init__.py
Line 487 in f674505
Description of user facing changes
None
Description of development approach
This pr changes logic to add the several addon directories to the package path in the addonHandler.
Testing strategy:
Tested a source copy of NVDA. Ensured that at least appModules and globalPlugins are loaded correctly. synthDrivers, visionEnhancementProviders and brailleDisplayDrivers need to be tested.
Known issues with pull request:
None known
Change log entries:
deprecations:
Code Review Checklist: