-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Module 'google.protobuf.any_pb2' has no 'Any' member #6281
Comments
I'm having a similar problem. It's related to this issue: protocolbuffers/protobuf#9730 The issue seems to stem from the fact that 3.20.0 However, there are correctly typed stub I'll see if I can get a complete example and post a new issue in the next couple days. (As an aside, the generated python protobuf code reads as something absolutely insane to python programmers.) |
This is pretty bad. A workaround like disabling |
|
@belm0 would you mind trying out the new astroid using |
pylint is not happy with astroid head, so I didn't get very far File "/.../python3.8/site-packages/pylint/checkers/typecheck.py", line 1688, in _check_invalid_sequence_index
if subscript.ctx is astroid.Store:
AttributeError: module 'astroid' has no attribute 'Store' |
Thank you for checking. My bad, it's going to be checkable but with |
This comment was marked as spam.
This comment was marked as spam.
Is there any update on this? And/or workarounds... |
This is blocking us from updating our ProtoBuf dependency, which in turn is blocking us from supporting Python 3.11. Any official update here would be appreciated. |
We would probably add a "astroid brain" for this to work. However, this is not something we would maintain in |
Are we asking for plugins for all the libs that need brains now ? I would be okay with that. But do we move the current astroid brains in their respective plugins for consistency ? Lot of work imo. But valuable to make astroid leaner. Also, I'm not sure there's interest in maintaining pylint-specific-lib-plugin, |
I think so? I don't use |
In case it helps anyone, we are using |
We can disable this rule because `mypy` already checks for this kind of errors and this also fixes a long-standing issue with `pylint` that can't figure out protobuf generate stuff have some members: * pylint-dev/pylint#6281 Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
We can disable this rule because `mypy` already checks for this kind of errors and this also fixes a long-standing issue with `pylint` that can't figure out protobuf generate stuff have some members: * pylint-dev/pylint#6281 And now that we disabled this check we can just use the protobuf modules instead of having to declare one alias per each symbol we need. We did this before just so we only need to use a `pylint` `disable=no-name-in-module` one time in the import instead each time we **used** the symbol.
Bug description
When running pylint on the following code:
Throws a linter warning since protobuf==3.20.0 (It still worked fine with 3.19.4)
Executing the code directly in python yields no error:
Configuration
No response
Command used
Pylint output
Expected behavior
No warning.
Pylint version
OS / Environment
Ubuntu 20.04
Additional dependencies
protobuf==3.19.4
protobuf==3.20.0
The text was updated successfully, but these errors were encountered: