-
-
Notifications
You must be signed in to change notification settings - Fork 745
remove glob import from versionInfo #18682
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the glob import (star import) from versionInfo.py to follow Python best practices and improve code clarity by explicitly importing only required variables.
- Replaces
from buildVersion import *with explicit imports in versionInfo.py - Updates all modules importing version-related variables to use buildVersion instead of versionInfo where appropriate
- Updates documentation and configuration files to reference the correct module for version information
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| source/versionInfo.py | Replaces glob import with explicit imports and updates string formatting |
| source/updateCheck.py | Changes imports from versionInfo to buildVersion for version checking |
| source/setup.py | Moves build-related imports to buildVersion module |
| source/installer.py | Updates version references to use buildVersion instead of versionInfo |
| source/gui/startupDialogs.py | Changes window title to use buildVersion.name |
| source/gui/init.py | Updates frame and system tray icon names to use buildVersion |
| source/core.py | Changes message window name to use buildVersion |
| source/appModules/nvda.py | Updates NVDA menu name to use buildVersion |
| sconstruct | Updates build configuration to use buildVersion variables |
| projectDocs/dev/developerGuide/developerGuide.md | Updates documentation example to use buildVersion |
| projectDocs/dev/developerGuide/conf.py | Updates Sphinx configuration to use buildVersion |
| appx/sconscript | Updates AppX package configuration to use buildVersion |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
There are many add-ons that use versionInfo.version_year and similar constants to check compatibility. I see why the glob was removed, but this is a kind of API breakage that we can and should avoid IMO. |
Follow up to nvaccess#18680 Summary of the issue: We use a glob import in versionInfo which is not recommended Description of user facing changes: Description of developer facing changes: versionInfo no longer imports all variables from buildVersion Description of development approach: Update imports
|
@LeonarddeR one of my least favourite features of Python is that there is no (good) way of disallowing transitive imports. I do think transitive imports are a useful feature, but I find it deeply irritating that because I import something into my module, it necessarily becomes available for import from my module. It makes problems like this almost unavoidable. I would really like if we could have - and enforce - a single, canonical import path for all public API symbols. All that being said, while painful I think this code clean up is ultimately positive. |
Follow up to nvaccess#18680 Summary of the issue: We use a glob import in versionInfo which is not recommended Description of user facing changes: Description of developer facing changes: versionInfo no longer imports all variables from buildVersion Description of development approach: Update imports
Link to issue number:
Follow up to #18680
Summary of the issue:
We use a glob import in versionInfo which is not recommended
Description of user facing changes:
Description of developer facing changes:
versionInfo no longer imports all variables from buildVersion
Description of development approach:
Update imports
Testing strategy:
Smoke tests
Known issues with pull request:
None
Code Review Checklist:
@coderabbitai summary