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

Remove not-context-manager lint rule #12399

Closed

Conversation

joesho112358
Copy link
Contributor

Summary

#9614 removing not-context-manager

Details and comments

This is the only way i could find to get the typing to not be an issue other than removing it completely

@joesho112358 joesho112358 requested a review from a team as a code owner May 14, 2024 15:24
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label May 14, 2024
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 9082005902

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 89.632%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 4 92.62%
Totals Coverage Status
Change from base Build 9080271824: 0.03%
Covered Lines: 62293
Relevant Lines: 69499

💛 - Coveralls

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Thanks for looking at this. I'm not super keen to merge this one as-is, because I think the problem is more likely a bug in Astroid's inference. I do think there's typing problems in the currently spelling, but when I fixed those locally (so mypy is happy with things), it didn't fix the inference that pylint/astroid were pulling out - they were detecting the return type from the context-manager form as None, which was definitely false.

I'm roughly keen to work out why pylint's getting it wrong, because I think there should be a version of the typing.overload hinting that works - I think removing it entirely will cause Mypy to fail (not that it passes on Qiskit at the moment) because it would then think that it's undecideable whether the ersult . I think at the moment it's probably passing pylint only because it can't tell, so it errs on the safe side.

@joesho112358
Copy link
Contributor Author

joesho112358 commented May 15, 2024

@jakelishman not surprised about not being keen on it- i wasn't thrilled about the possible mismatching
of types i introduced with this, but figured something that works was a starting point! removing the typing did appear to work for me (not sure for Mypy), but figured keeping the possible mismatch of typing would be preferred over removal. i'll look to try a couple more things with the typing.overload

@joesho112358
Copy link
Contributor Author

looks like it's better to close this as the base has changed and the current changes are not inline with expectations. a fresh start is best i think, but i will probably have to bow out as well from this since i haven't made much progress

@joesho112358 joesho112358 deleted the remove-not-context-manager branch May 16, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PR PRs from contributors that are not 'members' of the Qiskit repo
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants