Skip to content

Introduce CI type-checking harness. - #952

Merged
junkmd merged 3 commits into
enthought:mainfrom
junkmd:951-introduce-ci-type-checking
Oct 2, 2026
Merged

junkmd merged 3 commits into
enthought:mainfrom
junkmd:951-introduce-ci-type-checking

Conversation

@junkmd

@junkmd junkmd commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Building on the background and motivation outlined in #951, this PR introduces a standalone static type-checking harness into the CI pipeline as an initial step.

With a view toward expanding type documentation and guides in the future, the primary goal here is to establish a minimal CI test harness that verifies the consistency between runtime behavior and static type definitions generated via client.GetModule.

Motivation & Scope

  • Verify Consistency for client.GetModule Types:
    Ensure that generated COM wrapper classes and interfaces generated by client.GetModule are accurately inferred by type checkers against the actual runtime implementations.
  • Establish a Lightweight Test Harness:
    Set up an isolated type-check/ environment and dedicated CI workflow to pave the way for future documentation, examples, and test expansion without polluting the main test suite.
  • Python 3.10+ Type-Checking in CI:
    In line with the phased transition plan, runtime compatibility with Python 3.9 is preserved, while static type-checking jobs run on Python 3.10+ to satisfy modern type-checker requirements.

junkmd added 3 commits October 3, 2026 00:14
- Add a `type-check` job to `.github/workflows/autotest.yml` targeting
  Python 3.10 to 3.14 on Windows.
- Build `comtypes` as an sdist and install it into an isolated `.venv`
  under `type-check/` to test against the installed package.
- Add `type-check/tests/test_packaging.py` to ensure `comtypes` is loaded
  from `site-packages` rather than the local workspace source.
- Update `.github/workflows/autofmt.yml` to format and lint `type-check/.`
  with ruff.
…g tests

- Extend `type-check` CI job matrix with type checkers (`ty`, `mypy`, `pyright`).
- Add `type-check/pyproject.toml` configuring type-checking tools and their dependencies.
- Add `type-check/tests/test_scrrun.py` to verify type inference and assertions
  on generated COM classes (`Scripting.Dictionary`) via `client.GetModule`.
- Add `type-check/tests/test_uia.py` to verify runtime types and static type
  inference for generated `IUIAutomation` and `IUIAutomationElement` classes.
- Ensure standard COM interfaces reject call and subscript operations both at
  runtime and during static type checking.
@junkmd junkmd added this to the 1.5.0 / Support Python 3.15 milestone Oct 2, 2026
@junkmd junkmd added tests enhance or fix tests typing related to Python static typing system ci labels Oct 2, 2026
@codecov-commenter

codecov-commenter commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.98%. Comparing base (32d3573) to head (d860a22).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #952   +/-   ##
=======================================
  Coverage   88.98%   88.98%           
=======================================
  Files         140      140           
  Lines       13678    13678           
=======================================
  Hits        12171    12171           
  Misses       1507     1507           

☔ 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 715ab82 into enthought:main Oct 2, 2026
235 of 257 checks passed
@junkmd
junkmd deleted the 951-introduce-ci-type-checking branch October 2, 2026 22:46
@junkmd junkmd linked an issue Oct 2, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci tests enhance or fix tests typing related to Python static typing system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce CI type-checking

2 participants