question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] pylint no-member warning for `tool_requires` and `test_requires`

See original GitHub issue

Environment 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:

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hofbicommented, Sep 7, 2022

@agagniere There is a specific section about this in the docs: https://docs.conan.io/en/latest/integrations/linting/recipe.html

1reaction
hofbicommented, Sep 6, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found