Skip to content

Add ty for CI Type Checking#185

Merged
cenwangumass merged 3 commits into
developmentfrom
feature_CI_type_checking
Nov 18, 2025
Merged

Add ty for CI Type Checking#185
cenwangumass merged 3 commits into
developmentfrom
feature_CI_type_checking

Conversation

@Grochocinski

Copy link
Copy Markdown
Collaborator

Fixes #179

The two main fast type-checkers for Python at the moment are ty and Pyrefly, although both are still quite early in development. While searching for comparisons between the two, I found this interesting article on the subject that compares their advantages/disadvantages as well as diving into each type checker's approach to type resolution. Highly recommend reading it.

I ended up selecting ty for type checking since it's made by Astral (the developers of the Ruff linter/formatter, which we already use, and the uv package manager, which our project is compatible with and I personally use. I've had great experiences with all of Astral's products and from my experiences so far with ty, I believe it will continue that trend. Additionally, after reading the linked article above, I think ty's more forgiving inferred typing and significantly clearer error messages will be advantageous when trying to type current-untyped existing classes such as the GUIs.

Since this PR is just for the action itself, the typing errors will need to be addressed at a later time. This would be the case regardless of which type-checker we got with.

@Grochocinski Grochocinski added the enhancement New feature or request label Nov 10, 2025
@Grochocinski Grochocinski force-pushed the feature_CI_type_checking branch from dea7116 to 145df2b Compare November 14, 2025 04:28
@Grochocinski

Copy link
Copy Markdown
Collaborator Author

had to rebase/force-push to sort out a merge conflict, branch-specific commits remain unchanged.

exclude failing files from check until fixed
@Grochocinski Grochocinski force-pushed the feature_CI_type_checking branch from 145df2b to 337d06a Compare November 14, 2025 05:04
@Grochocinski

Copy link
Copy Markdown
Collaborator Author

I adjusted the exclude list to individually list all failing files with the expectation that:

  1. No additional files will be added to this list (under normal circumstances)
  2. Work will be performed to fix any issues ty is flagging in these files, at which point they will be removed from the exclude list

This essentially just modifies the behavior of the ty action to pass for now while we work on fixing the typing backlog we now have.

@cenwangumass cenwangumass merged commit 337d06a into development Nov 18, 2025
5 checks passed
@cenwangumass cenwangumass deleted the feature_CI_type_checking branch November 18, 2025 04:55
@Grochocinski Grochocinski linked an issue Nov 22, 2025 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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitHub Action for Type Checking

2 participants