codegraph icon indicating copy to clipboard operation
codegraph copied to clipboard

Parsing error

Open ArneBachmannDLR opened this issue 2 years ago • 3 comments

Getting this on Python 3.11:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\bach_ar\.conda\envs\311\Scripts\cg.exe\__main__.py", line 7, in <module>
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\main.py", line 18, in cli
    main(args)
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\main.py", line 22, in main
    usage_graph = core.CodeGraph(args).usage_graph()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\core.py", line 75, in usage_graph
    entities_lines, imports, modules_names_map = get_imports_and_entities_lines(self.modules_data)
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bach_ar\.conda\envs\311\Lib\site-packages\codegraph\core.py", line 126, in get_imports_and_entities_lines
    pathed_import, alias = pathed_import.split(' as ')
    ^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 2)

Maybe the "import ... as ... " is not correctly supported? The last file shown before the error was __main__.py which is always kind of special, the code in question might be this somewhat messed up line: if '--imports' in sys.argv: from .progress import setup as import_logger; import_logger()

ArneBachmannDLR avatar Apr 18 '23 02:04 ArneBachmannDLR

@ArneBachmannDLR, hello! Thanks for opening the issue, I will take a look on it later

xnuinside avatar Apr 18 '23 05:04 xnuinside

Please assign to me

Kedarnath-Rothe avatar Oct 08 '23 18:10 Kedarnath-Rothe

@Kedarnath-Rothe I'm working on the new version - will release on this weekends, it will contain new visualisation & solve this issue also

xnuinside avatar Oct 09 '23 10:10 xnuinside