Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Pin numpy<2.2 in lint workflow (backport #722) #723

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented 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.


This is an automatic backport of pull request #722 done by Mergify.

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
@mergify mergify bot added the conflicts label Dec 12, 2024
Copy link
Author

mergify bot commented Dec 12, 2024

Cherry-pick of d44ca0a has failed:

On branch mergify/bp/stable/0.9/pr-722
Your branch is up to date with 'origin/stable/0.9'.

You are currently cherry-picking commit d44ca0a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   pyproject.toml

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12305159558

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 12299527356: 0.0%
Covered Lines: 2330
Relevant Lines: 2330

💛 - Coveralls

@garrison garrison added cicd Related to the CICD pipeline and removed conflicts labels Dec 12, 2024
@garrison garrison merged commit f514b8e into stable/0.9 Dec 12, 2024
11 checks passed
@garrison garrison deleted the mergify/bp/stable/0.9/pr-722 branch December 12, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cicd Related to the CICD pipeline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants