Skip to content

Type-check Cloup with Pyrefly alongside Mypy #216

Description

@janluke

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions