Fix lint errors due to Pylint 3.3.0 update in CI #833
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
pylint : disable
comments to fix CI errors caused by the recent update to Pylint 3.3.0. These changes are needed for tests to pass on Python 3.9 and above, where stricter rules are now in place.Details
With Pylint 3.3.0, new checks flag some functions for having too many positional arguments, even when many of these are used as keyword arguments. This includes errors like
too-many-positional-arguments
(R0917), which have started showing up in several places in the code.Since these issues aren't related to the core changes in this PR, I've added inline disables to silence the new warnings. This is in line with what was done in other Qiskit repositories, such as Qiskit Algorithms qiskit-community/qiskit-algorithms#203 (comment), when faced with similar lint rule updates.
This is a temporary solution. Later on, we may look at adjusting the methods to avoid the need for these disables.
Python 3.8, which still uses Pylint 3.2.7, is unaffected and passes tests. However, Python 3.8 support will soon be dropped: #826
What’s next
Once this PR is merged, the CI pipeline should run successfully for all versions, including the nightly builds on Python 3.9+. Future PRs will also pass lint checks until a more permanent solution is implemented.