Skip to content

CI type check mypy is failing #7656

@ToastCheng

Description

@ToastCheng

Describe the issue

When uploading the PR #7655, I found this failure that is irrelevant to my change.

cirq-core/cirq/transformers/heuristic_decompositions/two_qubit_gate_tabulation.py:112: error: Need type annotation for "inner_gates"  [var-annotated]
cirq-core/cirq/linalg/transformations.py:85: error: Argument "key" to "max" has incompatible type "Callable[[tuple[Any, ...]], ndarray[tuple[Any, ...], dtype[floating[Any]]]]"; expected "Callable[[tuple[Any, ...]], SupportsDunderLT[Any] | SupportsDunderGT[Any]]"  [arg-type]
cirq-core/cirq/linalg/transformations.py:85: error: Incompatible return value type (got "ndarray[tuple[Any, ...], dtype[floating[Any]]]", expected "SupportsDunderLT[Any] | SupportsDunderGT[Any]")  [return-value]
cirq-core/cirq/ops/clifford_gate.py:642: error: Argument "key" to "max" has incompatible type "Callable[[tuple[Any, ...]], ndarray[tuple[Any, ...], dtype[floating[Any]]]]"; expected "Callable[[tuple[Any, ...]], SupportsDunderLT[Any] | SupportsDunderGT[Any]]"  [arg-type]
cirq-core/cirq/ops/clifford_gate.py:642: error: Incompatible return value type (got "ndarray[tuple[Any, ...], dtype[floating[Any]]]", expected "SupportsDunderLT[Any] | SupportsDunderGT[Any]")  [return-value]
cirq-core/cirq/sim/clifford/stabilizer_state_ch_form.py:291: error: Unused "type: ignore" comment  [unused-ignore]
cirq-core/cirq/sim/clifford/stabilizer_state_ch_form.py:292: error: Unused "type: ignore" comment  [unused-ignore]
cirq-core/cirq/sim/clifford/stabilizer_state_ch_form.py:293: error: Unused "type: ignore" comment  [unused-ignore]
cirq-core/cirq/sim/clifford/stabilizer_state_ch_form.py:294: error: Unused "type: ignore" comment  [unused-ignore]
cirq-core/cirq/sim/state_vector_simulation_state_test.py:120: error: Argument "dtype" to "StateVectorSimulationState" has incompatible type "dtype[Any]"; expected "type[complexfloating[Any, Any]]"  [arg-type]
cirq-core/cirq/sim/state_vector_simulation_state_test.py:139: error: Argument "dtype" to "StateVectorSimulationState" has incompatible type "dtype[Any]"; expected "type[complexfloating[Any, Any]]"  [arg-type]
Found 11 errors in 5 files (checked 1126 source files)

This failure can be reproduced locally as well, and I don't see any recent changes on the failing files, CI configuration etc.

One thing to note is that the type check only fails in the latest CI run on my PR, it's PASS in the previous round:

The difference between the two commit is just the commit message.

Explain how to reproduce the bug or problem

It is failing on CI, and also locally:

./check/mypy

Put long logs in HTML details blocks like this.

Tell us the version of Cirq where this happens

From latest source code

python -c 'import cirq; print(cirq.__version__)'
1.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions