pyan icon indicating copy to clipboard operation
pyan copied to clipboard

got multiple values for argument 'root' after upgrade 1.1.1 -> 1.20

Open laimaretto opened this issue 4 years ago • 5 comments
trafficstars

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

laimaretto avatar Oct 02 '21 15:10 laimaretto

same problem!

yoxu515 avatar Oct 11 '21 03:10 yoxu515

Looks this was fixed in #65

mailhost avatar Nov 16 '21 11:11 mailhost

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)

z0gSh1u avatar Nov 26 '21 13:11 z0gSh1u

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

jl1011 avatar Mar 07 '22 22:03 jl1011

Would it be possible to proceed with publishing the next version release seeing as this issue is now fixed?

ColtAllen avatar Apr 16 '22 23:04 ColtAllen