proycon/codemetapy

Error when parsing python projects

broeder-j opened this issue · 2 comments

Hi there. First thanks for your work. So far I could not make it work for any of my python projects with pyproject.toml using poetry as a build system. I always end up with this error below. So I tried if I can do it for codemetapy after a simple pip install of it and it fails in the same way.

I am on linux. Python 3.8.10

$codemetapy codemetapy > codemeta.json
Passed 1 files/sources but specified 0 input types! Automatically guessing types...
Detected input types: []
Traceback (most recent call last):
  File "/work/envs/db/bin/codemetapy", line 8, in <module>
    sys.exit(main())
  File "/work/envs/db/lib/python3.8/site-packages/codemeta/codemeta.py", line 136, in main
    g, res, args, contextgraph = build(**args.__dict__)
  File "/work/envs/db/lib/python3.8/site-packages/codemeta/codemeta.py", line 288, in build
    identifier = os.path.basename(inputsources[0][0]).lower()
IndexError: list index out of range

Ok, I made it work by specifying the input type -i python. I leave this open because maybe you would like to stop if no input types are detected instead of running into the later exception. Or you want to improve the type detection.

Thanks for the feedback! There was indeed something missing in the type detection. The above commit should fix it.