Skip to content

Modernize IGlobalInterfaceTable with type hints.#941

Merged
junkmd merged 4 commits into
enthought:mainfrom
junkmd:modernize_git
Jun 14, 2026
Merged

Modernize IGlobalInterfaceTable with type hints.#941
junkmd merged 4 commits into
enthought:mainfrom
junkmd:modernize_git

Conversation

@junkmd

@junkmd junkmd commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Overview

Introduced type hints to IGlobalInterfaceTable methods, performed code cleanup in comtypes/git.py, and resolved linter errors.
These changes improve type safety for cross-apartment COM interface operations.

junkmd added 4 commits June 14, 2026 22:09
…ores.

- Replace wildcard `ctypes` import with explicit `POINTER` import.
- Remove unused `COMMETHOD` import.
- Remove `comtypes/git.py` from `per-file-ignores` in `pyproject.toml`.
…omtypes/git.py`.

The manual test code in the main block is no longer needed as the functionality
is covered by other tests or was intended only for local verification.
Add `# type: ignore` to `RegisterInterfaceInGlobal`, `GetInterfaceFromGlobal`,
and `RevokeInterfaceFromGlobal` in `IGlobalInterfaceTable` to suppress type
checking errors for generated `__com_*` methods.
- Use `TypeVar` `_T_IUnknown` to define generic interface types.
- Add type hints to `RegisterInterfaceInGlobal`, `GetInterfaceFromGlobal`,
  and `RevokeInterfaceFromGlobal`.
- Update method signatures to use `_T_IUnknown` for improved type safety.
@junkmd junkmd added typing related to Python static typing system coding style Topics related to style, formatters, linters, and delinting. labels Jun 14, 2026
@codecov-commenter

codecov-commenter commented Jun 14, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.94%. Comparing base (74300b2) to head (403e677).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #941   +/-   ##
=======================================
  Coverage   88.94%   88.94%           
=======================================
  Files         139      139           
  Lines       13649    13651    +2     
=======================================
+ Hits        12140    12142    +2     
  Misses       1509     1509           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@junkmd junkmd merged commit f62fbc0 into enthought:main Jun 14, 2026
50 checks passed
@junkmd junkmd deleted the modernize_git branch June 14, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding style Topics related to style, formatters, linters, and delinting. typing related to Python static typing system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants