Cloup publishes type annotations as part of its public API, so those annotations should work reliably with the type checkers used by downstream projects. Mypy is currently our only compatibility gate, but type checkers differ in inference and in areas where the typing specification leaves room for interpretation. Running an independent checker can reveal annotation problems and portability assumptions that Mypy alone does not expose.
Using multiple checkers is established practice for typing-focused libraries. Click runs Mypy and Pyright, while attrs has configurations for Mypy, Pyright, Pyrefly, and ty. Pyrefly is fast enough that adding it should have limited impact on development and CI time.
Since Pyrefly is stricter than Mypy and raises lots of formal errors when running in strict mode, the plan is the following is:
- add Pyrefly in "default" mode
- eventually enable "strict" mode.
Cloup publishes type annotations as part of its public API, so those annotations should work reliably with the type checkers used by downstream projects. Mypy is currently our only compatibility gate, but type checkers differ in inference and in areas where the typing specification leaves room for interpretation. Running an independent checker can reveal annotation problems and portability assumptions that Mypy alone does not expose.
Using multiple checkers is established practice for typing-focused libraries. Click runs Mypy and Pyright, while attrs has configurations for Mypy, Pyright, Pyrefly, and ty. Pyrefly is fast enough that adding it should have limited impact on development and CI time.
Since Pyrefly is stricter than Mypy and raises lots of formal errors when running in strict mode, the plan is the following is: