it-depends icon indicating copy to clipboard operation
it-depends copied to clipboard

Exception triggers when generating HTML output (for Go projects)

Open Hamid-K opened this issue 3 years ago • 0 comments

Using the --output-format html (with or without -o out.html) results in the following exception and creation of an empty report file. I have encountered this only while auditing a Go project.

it-depends ../project-code/ --depth-limit 3 --output-format html:

Traceback (most recent call last):
  File "/Users/user/.pyenv/versions/3.8.12/bin/it-depends", line 8, in <module>
    sys.exit(main())
  File "/Users/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/it_depends/cli.py", line 201, in main
    output_file.write(graph_to_html(package_list, collapse_versions=not args.all_versions))
  File "/Users/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/it_depends/html.py", line 94, in graph_to_html
    graph = graph.collapse_versions()
  File "/Users/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/it_depends/dependencies.py", line 325, in collapse_versions
    version = max(p.version for p in instances)
TypeError: '>' not supported between instances of 'GoVersion' and 'GoVersion'

JSON and Dot output formats work as expected. Tested with it-depends version 0.1.1 installed via pip on Python 3.8.12.

Hamid-K avatar Jul 11 '22 15:07 Hamid-K