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

Activity

  1. rosspeili commented on Jul 11, 2026

    @rosspeili
    Contributor

    @mhucka when @pavoljuhas is back, and if you guys agree, I can pick this both for Cirq and OpenFermion.

  2. mhucka commented on Jul 24, 2026

    @mhucka
    CollaboratorAuthor

    @rosspeili Pyrefly is a "go". Thanks for volunteering!

  3. rosspeili commented on Jul 24, 2026

    @rosspeili
    Contributor

    Thanks @mhucka, I will start with OpenFermion, and if you like the approach, feel free to assign the relevant Cirq issue as well. 🙏

  4. pavoljuhas commented on Jul 24, 2026

    @pavoljuhas
    Collaborator

    @rosspeili - if possible, please use ASCII characters instead of ツンデレ as your author name in git commits, which will make them easier to find in git logs.

  5. rosspeili commented on Jul 25, 2026

    @rosspeili
    Contributor

    Hey @pavoljuhas added the username as prefix. Hope this works better. <3

  6. rosspeili commented on Jul 25, 2026

    @rosspeili
    Contributor

    Migration pr is in #1433, and CI looks green. Lmk how this looks @mhucka / @pavoljuhas and if I am missing something. Thanks <3

  7. added
    e: experiencedExperience: needs familiarity with OpenFermion development
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: healthArea: code and/or project healtha: pythonArea: Python codee: experiencedExperience: needs familiarity with OpenFermion development

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions