Skip to content

Switching from mypy to Pyrefly for Python type checking #1091

Description

@mhucka

What is your request or suggestion?

Is your feature request related to a use case or problem?

A number of other projects are switching from mypy to Pyrefly for type checking Python code. We should do the same for Quantumlib projects if possible. Pyrefly is much faster than mypy and has better IDE support.

What solution or approach do you envision?

  1. Use Pyrefly's facility for creating a configuration based on an existing mypy configuration
  2. Run Pyrefly to find and fix whatever problems it flags
  3. Add a Pyrefly hook configuration to .pre-commit-config.yaml
  4. Replace the type check in CI with a Pyrefly-based one

How urgent is this for you?

P2 – needed within two quarters

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions