-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Bug pylint 4960 #1176
Bug pylint 4960 #1176
Conversation
Hey, the issue with the CI was fixed, you can rebase on main :) |
Thanks @Pierre-Sassoulas ! |
@Pierre-Sassoulas have you got an idea why the CI test is failing? Here is the stack:
|
Coveralls is down. They are doing a database update it seems. |
Thanks @DanielNoord ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to rebase on main instead of merging, please ? There's change from the main branch mixed in the diff so it's hard to review (especially considering that there was a lot of changes between f-strings migration and membership check migration from tuple to set)
e34614e
to
dc8d45e
Compare
@Pierre-Sassoulas i just rebase. Now there are only 4 files that are different! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good. Just some small comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last comment.
--
@hippo91 It would be great if you don't resolve review comments yourself. That makes it really difficult to see any comments you might add. Better to just add 👍🏻 and let the person who left the comment resolve it.
(Accepting suggestions is somewhat different as Github auto-resolves those. No need to unresolve them afterwards.)
tests/unittest_brain_numpy_ma.py
Outdated
from astroid import builder | ||
|
||
|
||
@pytest.mark.skipif(not HAS_NUMPY, reason="This test requires the numpy library.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pytest.mark.skipif(not HAS_NUMPY, reason="This test requires the numpy library.") | |
@pytest.mark.skipif(HAS_NUMPY is False, reason="This test requires the numpy library.") |
Technically the same. Might be just personal preference as this is how I think of it.
@hippo91 Could you rebase this PR onto |
to prevent nodes that are dynamically imported to be inferred through an astroid's brain, the way it was done in builder.py was incorrect. The way it was done, lead to prevent the use of astroid legetimate brains even for node that was not dynamically loaded.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
29daa03
to
a6a9c56
Compare
for more information, see https://pre-commit.ci
@cdce8p it should be ok now. Sorry for that. I don't know what kind of mess i did with this branch. |
Steps
Description
The PR #1148 introduced a regression that causes pylint-dev/pylint#4960.
While the idea behind #1148 may be a good idea, its implementation was faulty and prevent the use of brains even if the node that are modified inside those brains are not part of a potentially dynamically loaded module.
I didn't find a correct implementation that prevent the modification of nodes that are defined inside a dynamically loaded module.
That's why this PR is a partial revert of #1148. (revert concerns only the
builder
module).I also added a
numpy
brain that allowspylint
to infer correctly the call tonumpy.ma.masked_where
function so that pylint-dev/pylint#3342 will be definitely closed.Type of Changes
Related Issue
Closes pylint-dev/pylint#3342
Closes pylint-dev/pylint#4960