pyan
pyan copied to clipboard
got multiple values for argument 'root' after upgrade 1.1.1 -> 1.20
Hi! So I upgraded from pyan 1.1.1 to 1.20 and after that, I'm getting the following error:
$ pyan3 taskAutom.py --uses --no-defines --colored --grouped --annotated --dot-rankdir LR --html > taskAutom.html
Traceback (most recent call last):
File "/usr/local/bin/pyan3", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/pyan/main.py", line 206, in main
v = CallGraphVisitor(filenames, logger, root=root)
TypeError: __init__() got multiple values for argument 'root'
I could generate the graph for taskAutom with version 1.1.1 but not anymore with 1.2.0.
Any hint?
Thanks!
Lucas
same problem!
Looks this was fixed in #65
Workaround: Using pyan from a Python script doesn't encounter this.
import pyan
callgraph = pyan.create_callgraph('somewhere/**/*.py', format='dot', <other arguments>)
with open('somewhere.dot', 'w') as f:
f.write(callgraph)
I had to do a tiny bit of editing cause I didn't understand what z0gSh1u meant, but basically:
import pyan
callgraph = pyan.create_callgraph('C:\\PATH\\TO\\YOUR\\FILE\\MAINFOLDER\\*.py', format='html')
with open('WHAT_YOU_WANT_THE_GRAPH_FILE_TO_BE_CALLED.html', 'w') as f:
f.write(callgraph)
and that, put pretty much anywhere in my code, puts every py file in the folder specified by the path into the graph :)
Would it be possible to proceed with publishing the next version release seeing as this issue is now fixed?