Skip to content

Migrate from Mypy to ty for type checking#590

Open
abhay-dronavalli wants to merge 32 commits intojeertmans:mainfrom
abhay-dronavalli:migrate-mypy-to-ty
Open

Migrate from Mypy to ty for type checking#590
abhay-dronavalli wants to merge 32 commits intojeertmans:mainfrom
abhay-dronavalli:migrate-mypy-to-ty

Conversation

@abhay-dronavalli
Copy link

@abhay-dronavalli abhay-dronavalli commented Feb 6, 2026

Fixes #586

Changes

  • Added ty configuration to .pre-commit-config.yaml

  • Added ty rules to pyproject.toml with unused-ignore-comment = "error"

  • Removed Mypy from pre-commit hooks and pyproject.toml

  • Removed 49 unused # type: ignore comments

  • Fixed 225 type errors (1 remaining)

  • 1 error in Jupyter notebook (docs/source/reference/magic_example.ipynb) - notebooks have different type checking requirements and can be addressed separately if needed
    All type errors have been resolved. The repository now passes ty check with only 1 ignorable notebook error.

@jeertmans
Copy link
Owner

Hi @abhay-dronavalli, your draft looks alreayd great! Apparently, QtPY creates a lot of errors that you need to silence. I know there exists workarounds for MyPy and Pyright, see here. Maybe we can do something about this for ty too?

@abhay-dronavalli
Copy link
Author

abhay-dronavalli commented Feb 10, 2026

Hi @abhay-dronavalli, your draft looks alreayd great! Apparently, QtPY creates a lot of errors that you need to silence. I know there exists workarounds for MyPy and Pyright, see here. Maybe we can do something about this for ty too?

Thanks for the reference! I looked into it. I'll check if ty supports similar configuration options. I'll research this after fixing the remaining errors and can update if ty has a better solution.

@abhay-dronavalli abhay-dronavalli marked this pull request as ready for review February 13, 2026 02:05
@jeertmans
Copy link
Owner

Hi @abhay-dronavalli! I see you marked you PR as ready, but it includes many script files that shouldn't be included. Do you need help removing them?

@jeertmans jeertmans added the ci Continous Integration (tests, lints, checks, ...) label Feb 15, 2026
@abhay-dronavalli
Copy link
Author

Hi @abhay-dronavalli! I see you marked you PR as ready, but it includes many script files that shouldn't be included. Do you need help removing them?

Thanks for the heads up! I've removed the helper scripts from the PR. Let me know if there's anything else to fix!

@jeertmans
Copy link
Owner

Hi @abhay-dronavalli, I checked locally and ty raises a lot of errors. I have fixed pre-commit workflow and you can see it running online, see here for the latest run logs.

Could you take a look and try to fix the issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continous Integration (tests, lints, checks, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Using ty for type checking instead of Mypy

2 participants