Skip to content

Switch to Pyrefly for type checking instead of mypy #1399

Description

@mhucka

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

    area/healthInvolves code and/or project healtharea/pythonInvolves Python codepriority/after-1.7.2Things to do after the next release

    Fields

    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions