Move Windows API bindings out of hwPortUtils#18571
Merged
Merged
Conversation
6 tasks
Member
|
Is this something we can hold off on until #18207 is merged, or merge separately? |
Member
Author
|
@seanbudd I think this can be merged separately - I just tried rebasing on master and running from source without any of the changes from wip-buildX64 and it seemed to work fine for me. We'll need to adjust some docs, and may need to add some shims to prevent breaking the API. Want me to re target this to master? |
Member
|
That would be great - if we can't easily retain backwards compatibility I think that's fine though. We should be branching very soon for 2026.1. just being able to review and merge this separately to the main PR would be nice |
70892d7 to
45c2f62
Compare
seanbudd
approved these changes
Aug 25, 2025
Member
|
All looks good to me, please make sure to update deprecations.md at some point |
SaschaCowley
added a commit
that referenced
this pull request
Aug 25, 2025
5 tasks
SaschaCowley
added a commit
that referenced
this pull request
Aug 25, 2025
Follow-up to #18571 Summary of the issue: #18571 erroneously included its API changes in the 2025.3 section of the changes file. Description of user facing changes: None Description of developer facing changes: API changes are correctly included in the 2026.1 section of the changes file. Description of development approach: Moved lines. Testing strategy: None needed. Known issues with pull request: None.
5 tasks
SaschaCowley
added a commit
that referenced
this pull request
Aug 25, 2025
### Link to issue number: Follow-up to #18571 Follow-up to #18804 ### Summary of the issue: There were a few errors in the changes introduced by #18571 that weren't caught in #18804. ### Description of user facing changes: None ### Description of developer facing changes: Cosmetic fixes to changes introduced in #18571. ### Description of development approach: Merge 2 change log items, add missing asterisk. ### Testing strategy: None ### Known issues with pull request: None ### Code Review Checklist: - [x] Documentation: - Change log entry - User Documentation - Developer / Technical Documentation - Context sensitive help for GUI changes - [x] Testing: - Unit tests - System (end to end) tests - Manual testing - [x] UX of all users considered: - Speech - Braille - Low Vision - Different web browsers - Localization in other languages / culture than English - [x] API is compatible with existing add-ons. - [x] Security precautions taken.
This was referenced Aug 26, 2025
seanbudd
pushed a commit
that referenced
this pull request
Aug 28, 2025
Follow-up to #18571 Summary of the issue: As part of #18571, I wrote code that made handling a large number of module-level deprecations easier. Since this code made handling module-level deprecations more systematic and auditable, the code was split out into its own module. As we wanted to get #18571 merged to unblock other work, documentation for that utility was not added in that PR. Description of user facing changes: None Description of developer facing changes: Adds documentation on the novel strategy for handling module-level deprecations. Description of development approach: Wrote documentation.
SaschaCowley
added a commit
that referenced
this pull request
Aug 28, 2025
…rom source (#18823) Follow-up to #18571 Summary of the issue: The deprecation helper introduced in #18571 automatically detects the module it's being used in. This detection is broken when running a portable or installed copy. Description of user facing changes: None. Description of developer facing changes: The module is now reported correctly when emitting deprecation warnings. Description of development approach: Rather than using `inspect.getmodule`, get `__name__` from the frame's globals. Testing strategy: Tested importing `BLUETOOTH_ADDRESS` from `hwPortUtils` from source and in a portable (created with `scons dist`). Applied the following patch and attempted importing `_remoteClient.client.seven` when running from source and portable. ```patch diff --git a/source/_remoteClient/client.py b/source/_remoteClient/client.py index 4691a22..541ec8f2a 100644 --- a/source/_remoteClient/client.py +++ b/source/_remoteClient/client.py @@ -743,3 +743,8 @@ def connectedClientsCount(self) -> int: stack_info=True, ) return 0 + +from utils._deprecate import handleDeprecations, RemovedSymbol +__getattr__ = handleDeprecations( + RemovedSymbol("seven", 7) +) ``` Known issues with pull request: None
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:
Part of #16304
Related to #18207
Summary of the issue:
hwPortUtilshad a lot of ctypes bindings.Description of user facing changes:
None
Description of developer facing changes:
Almost all of these bindings have been moved to the
winBindingssubpackage.Description of development approach:
Used VS Code's refactoring tools to move the ctypes code. Used the Microsoft Learn pages and the header files in the Windows 10 SDK to add type information.
Testing strategy:
Tested connecting a Brailleedge 40 via USB and Bluetooth with automatic detection.
Used
dir(hwPortUtils)to find all symbols accessible fromhwPortUtilswithout this PR. Manually filtered the list to exclude transitive imports. Ran NVDA from source with this PR checked out and made sure that:Known issues with pull request:
The definition of
SP_DEVICE_INTERFACE_DETAIL_DATA_Whas not been moved, as its definition relies on variables in its closure.Code Review Checklist:
@coderabbitai summary