qiskit-community / qiskit-aqua

Quantum Algorithms & Applications (**DEPRECATED** since April 2021 - see readme for more info)
https://qiskit.org/aqua
Apache License 2.0
574 stars 376 forks source link

Pylint 2.6.1 stops by error #1534

Closed t-imamichi closed 3 years ago

t-imamichi commented 3 years ago

Information

What is the current behavior?

pylint 2.6.1 stops by error.

Steps to reproduce the problem

$ make lint
pylint -rn --ignore=gauopen qiskit/aqua qiskit/chemistry qiskit/finance qiskit/ml qiskit/optimization test tools
Traceback (most recent call last):
  File "/Users/ima/envs/dev38/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/__init__.py", line 22, in run_pylint
    PylintRun(sys.argv[1:])
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/lint/run.py", line 349, in __init__
    linter.check(args)
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 862, in check
    self._check_files(
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 896, in _check_files
    self._check_file(get_ast, check_astroid_module, name, filepath, modname)
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 922, in _check_file
    check_astroid_module(ast_node)
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1054, in check_astroid_module
    retval = self._check_astroid_module(
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1099, in _check_astroid_module
    walker.walk(ast_node)
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 72, in walk
    callback(astroid)
  File "/Users/ima/envs/dev38/lib/python3.8/site-packages/pylint/checkers/refactoring/len_checker.py", line 61, in visit_call
    if not utils.is_call_of_name(node, "len"):
AttributeError: module 'pylint.checkers.utils' has no attribute 'is_call_of_name'
make: *** [lint] Error 1

What is the expected behavior?

Suggested solutions

Need to avoid pylint 2.6.1?

t-imamichi commented 3 years ago

pylint team recommends as follows.

pylint==2.6.0
astroid < 2.5

https://github.com/PyCQA/pylint/issues/4096#issuecomment-779668984

t-imamichi commented 3 years ago

pylint 2.6.2 is released. https://github.com/PyCQA/pylint/releases/tag/pylint-2.6.2

manoelmarques commented 3 years ago

pylint 2.6.2 fixed all the issues by pinning astroid. No need to change our code

Also, in the CI we test against the version used by Terra (2.4.4) and then test again against whatever the latest version is. We never test against intermediate pylint versions. I don't think we need to worry about them.

t-imamichi commented 3 years ago

Yes, I see pylint 2.6.2 fixes the issues in #1522