Switch type checking from mypy to Pyrefly (#8182) - #8227
Conversation
Add check/typecheck, deprecate check/mypy, and wire CI/deps/docs. Migrate config from mypy with monorepo search-path and notebook excludes.
Config choices and follow-upSince pyrefly is stricter than cirq’s previous mypy config ( Same idea as the OpenFermion pyrefly migration (#1433): migrate the checker first, tighten selectively later. Suggested follow-up unless otherwise advised
Happy to open that follow-ups after this lands, or adjust the disable list here if you’d rather tighten in this PR. @pavoljuhas @mhucka, this also covers #8225’s |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8227 +/- ##
=======================================
Coverage 99.60% 99.60%
=======================================
Files 1118 1118
Lines 101667 101667
=======================================
Hits 101261 101261
Misses 406 406 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Switch type checking from mypy to Pyrefly per 8182, also includes the
check/typecheckrename/deprecation from 8225, can close once this lands.[tool.mypy]withpyrefly init, then set monoreposearch-pathto matchdev_tools/pypath.cirq_google/cloud) as discussed on 8182.follow_imports=silent/skipthird-party posture toignore-missing-imports+replace-imports-with-anyfor sympy/networkx/pandas/protobuf.dtype is not None, cast beforesortedfor Qids).check/typecheck, deprecatedcheck/mypy(remove in v1.8), updated CI /check/all/ shellcheck / deps / docs.notes
mypy-protobuf/--mypy_outalone (stub generation, not the typechecker CLI).[tool.pyrefly.errors]for this migration.Test plan
pyrefly check→ 0 errors locallyFixes #8182