Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
laimaretto opened this issue Oct 2, 2021 · 5 comments
Open

Comments

@laimaretto
Copy link

laimaretto commented Oct 2, 2021

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

@yoxu515
Copy link

yoxu515 commented Oct 11, 2021

same problem!

@mailhost
Copy link

Looks this was fixed in #65

@z0gSh1u
Copy link

z0gSh1u commented Nov 26, 2021

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)

@jl1011
Copy link

jl1011 commented Mar 7, 2022

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

@ColtAllen
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants