Skip to content

Commit

Permalink
Pin numpy<2.2 in lint workflow (#722)
Browse files Browse the repository at this point in the history
Somehow, with numpy 2.2, the mypy fails with the following error:

```
qiskit_addon_cutting/cut_finding/circuit_interface.py:318: error: No overload variant of "__getitem__" of "Sequence" matches argument type "signedinteger[_32Bit | _64Bit]"  [call-overload]
qiskit_addon_cutting/cut_finding/circuit_interface.py:318: note: Possible overload variants:
qiskit_addon_cutting/cut_finding/circuit_interface.py:318: note:     def __getitem__(self, int, /) -> int | tuple[str, int]
qiskit_addon_cutting/cut_finding/circuit_interface.py:318: note:     def __getitem__(self, slice, /) -> Sequence[int | tuple[str, int]]
qiskit_addon_cutting/cut_finding/disjoint_subcircuits_state.py:330: error: Invalid index type "Hashable" for "ndarray[tuple[int, ...], dtype[signedinteger[_32Bit | _64Bit]]]"; expected type "SupportsIndex | slice | EllipsisType | _SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int] | tuple[SupportsIndex | slice | EllipsisType | _SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]] | dtype[integer[Any]]]] | builtins.bool | int | _NestedSequence[builtins.bool | int] | None, ...] | None"  [index]
```

Hence we pin numpy as a workaround.
  • Loading branch information
garrison authored Dec 12, 2024
1 parent 5f6dee6 commit d44ca0a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ lint = [
"mypy==1.13.0",
"reno>=3.4.0",
"pylint==3.3.1",
"numpy<2.2",
]
docs = [
"Sphinx>=3.0.0",
Expand Down

0 comments on commit d44ca0a

Please sign in to comment.