Closed fcabaud closed 2 years ago
Did you solve it? I also encountered the same one.
Can you provide a minimal example how to reproduce the crash, together with information which pylint
version and OS you are using?
The source file I parsed is train.py on here.
Versions are as follows: ubuntu 18.04 pylint 2.13.5 astroid 2.11.2 Python 3.6.9 (default, Mar 15 2022, 13:55:28) [GCC 8.4.0]
And following is my command (but if I use pyreverse -f ALL -ASmy ./train.py
, it works well)
.../Point-GNN$ pyreverse --module-names=y --class=module.entry.SumoRunner ./train.py
parsing ./train.py...
Traceback (most recent call last):
File "/home/bit202/.local/bin/pyreverse", line 8, in <module>
sys.exit(run_pyreverse())
File "/home/bit202/.local/lib/python3.6/site-packages/pylint/__init__.py", line 44, in run_pyreverse
PyreverseRun(argv or sys.argv[1:])
File "/home/bit202/.local/lib/python3.6/site-packages/pylint/pyreverse/main.py", line 213, in __init__
sys.exit(self.run(args))
File "/home/bit202/.local/lib/python3.6/site-packages/pylint/pyreverse/main.py", line 228, in run
diadefs = handler.get_diadefs(project, linker)
File "/home/bit202/.local/lib/python3.6/site-packages/pylint/pyreverse/diadefslib.py", line 217, in get_diadefs
diagrams.append(generator.class_diagram(project, klass))
File "/home/bit202/.local/lib/python3.6/site-packages/pylint/pyreverse/diadefslib.py", line 185, in class_diagram
klass = next(module.ilookup(klass))
File "/home/bit202/.local/lib/python3.6/site-packages/astroid/bases.py", line 147, in _infer_stmts
context=context,
astroid.exceptions.InferenceError: Inference failed for all members of ().
Thank you for the example.
Where is module.entry.SumoRunner
coming from? Is this an external dependency?
Thank you for your help. I think I make some mistakes as I am not so familiar with pyreverse. According to your hint, I changed the command to pyreverse --module-names=y -ASmy ./train.py
, and it works very well. Thank you very much again.
I'm going to close as answered / hard to reproduce without precision.
I got this bug in pyreverse
pyreverse -c PyreverseCommand -a1 -s1 -f ALL -o png ../mypath/myfile.py
parsing ../src/py/deminer/deminer_orchestrator.py...