Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pin numpy<2.2 in lint workflow #722

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Pin numpy<2.2 in lint workflow #722

merged 1 commit into from
Dec 12, 2024

Conversation

garrison
Copy link
Member

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.

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.
@garrison garrison added cicd Related to the CICD pipeline stable backport potential Suitable to be backported to most recent stable branch by Mergify labels Dec 12, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12299683720

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 12294469370: 0.0%
Covered Lines: 2330
Relevant Lines: 2330

💛 - Coveralls

@garrison garrison merged commit d44ca0a into main Dec 12, 2024
11 checks passed
@garrison garrison deleted the lint-pin-numpy branch December 12, 2024 16:36
mergify bot pushed a commit that referenced this pull request Dec 12, 2024
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.

(cherry picked from commit d44ca0a)

# Conflicts:
#	pyproject.toml
garrison added a commit that referenced this pull request Dec 12, 2024
* Pin numpy<2.2 in lint workflow (#722)

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.

(cherry picked from commit d44ca0a)

# Conflicts:
#	pyproject.toml

* resolve conflict

---------

Co-authored-by: Jim Garrison <garrison@ibm.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cicd Related to the CICD pipeline stable backport potential Suitable to be backported to most recent stable branch by Mergify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants