[bug] pylint no-member warning for `tool_requires` and `test_requires`
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: Ubuntu 22.04
- Compiler+version: gcc-11.2
- Conan version: 1.52.0
- Python version: 3.10.4
Steps to reproduce (Include if Applicable)
Within the conanfile.py
I use:
def build_requirements(self):
self.test_requires("gtest/1.12.1")
Running pylint with the conan plugin results in:
E1101: Instance of '...' has no 'test_requires' member (no-member)
As quick fix, I suppress the warning using # pylint: disable=no-member
References:
- pylint no-member warning: https://pylint.pycqa.org/en/latest/user_guide/messages/error/no-member.html
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
pylint no member issue but code still works vscode
FloatTensor , pylint in visual studio code claims that 'Module torch has no 'FloatTensor' member pylint(no-member). However, the code works fine ...
Read more >no-member / E1101 - Pylint 2.16.0-dev documentation
no-member / E1101#. Message emitted: %s %r has no %r member%s. Description: Used when a variable is accessed for a nonexistent member. Problematic...
Read more >Messages control - Pylint 2.16.0-dev documentation
In order to control messages, pylint accepts the following values: a symbolic message: no-member , undefined-variable etc. a numerical ID ...
Read more >Pylint features - Pylint 2.16.0-dev documentation
Name %r is used prior to global declaration Emitted when a name is used prior a global declaration, which results in an error...
Read more >1.9 PDF - Pylint Documentation
such as errors and warnings. ... message ids and categories like -d C,W,no-error,design ... print self.bla # pylint: disable=no-member.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@agagniere There is a specific section about this in the docs: https://docs.conan.io/en/latest/integrations/linting/recipe.html
Thank you for the detailed explanation. I also did not expect this a bug of conan itself but more on the conan pylint plugin. Looking at https://github.com/conan-io/conan/blob/develop/conans/pylint_plugin.py#L30, I could imagine that this could be solved by adding tool_requires and test_requires to that dict.