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

Fix lint errors due to Pylint 3.3.0 update in CI #833

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

edoaltamura
Copy link
Collaborator

@edoaltamura edoaltamura commented Sep 25, 2024

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.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11054135240

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 91.66%

Totals Coverage Status
Change from base Build 10468190654: 0.0%
Covered Lines: 4638
Relevant Lines: 5060

💛 - Coveralls

Copy link
Collaborator

@OkuyanBoga OkuyanBoga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very short term temporary fix for unit tests. Can be fixed later.

Copy link
Member

@woodsp-ibm woodsp-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thx

@edoaltamura edoaltamura merged commit 53e246a into qiskit-community:main Sep 30, 2024
19 checks passed
@edoaltamura edoaltamura deleted the add-lint-disables branch September 30, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants