quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.24k stars 1.01k forks source link

Update sources to pass typecheck with mypy==1.11.1 #6705

Closed pavoljuhas closed 1 month ago

pavoljuhas commented 1 month ago

Description of the issue

The check/mypy script reports 97 errors when run with the latest mypy-1.11.1 (released July 30, 2024). The CI checks are executed with mypy-1.2.0 which is 16 months old.

This issues is to track PRs to get the code in sync with mypy-1.11.1

Cirq version

1.5.0.dev at d94c457b5e3a6a75941e59cb3f70c7646e61c5cb

pavoljuhas commented 1 month ago

Here is how to run the type check in a fresh virtual environment for Python 3.10:

pip install -r dev_tools/requirements/mypy.env.txt
pip install "mypy==1.11.1"
check/mypy