Materials-Data-Science-and-Informatics / somesy

A CLI tool for synchronizing software project metadata
https://materials-data-science-and-informatics.github.io/somesy/main/
MIT License
12 stars 2 forks source link

codemeta related error when pyproject.toml file is in another folder #30

Closed mustafasoylu closed 11 months ago

mustafasoylu commented 1 year ago

I was trying to use somesy as a recommit hook in pida-site project and I got the below error. You can see from the .somesy.toml file, it should be ok. Pyproject.toml file also has name attribute.

ERROR    Error: 'PathDistribution' object has no attribute 'name'                                                                                  sync.py:146
DEBUG    Traceback (most recent call last):                                                                                                        sync.py:147
           File "/local/home/m.soylu/Documents/projects/somesy/src/somesy/cli/sync.py", line 143, in sync                                                     
             run_sync(conf)                                                                                                                                   
           File "/local/home/m.soylu/Documents/projects/somesy/src/somesy/cli/sync.py", line 166, in run_sync                                                 
             sync_command(conf)                                                                                                                               
           File "/local/home/m.soylu/Documents/projects/somesy/src/somesy/commands/sync.py", line 31, in sync                                                 
             _sync_codemeta(conf)                                                                                                                             
           File "/local/home/m.soylu/Documents/projects/somesy/src/somesy/commands/sync.py", line 72, in _sync_codemeta                                       
             if update_codemeta(conf):                                                                                                                        
           File "/local/home/m.soylu/Documents/projects/somesy/src/somesy/codemeta/__init__.py", line 45, in update_codemeta                                  
             cm_harvest = gen_codemeta(cm_sources)                                                                                                            
           File "/local/home/m.soylu/Documents/projects/somesy/src/somesy/codemeta/exec.py", line 25, in gen_codemeta                                         
             g, res, args, _ = build(                                                                                                                         
           File "/local/home/m.soylu/Documents/projects/somesy/.venv/lib/python3.9/site-packages/codemeta/codemeta.py", line 656, in build                    
             codemeta.parsers.python.parse_python(newgraph, res, source, crosswalk, args)                                                                     
           File "/local/home/m.soylu/Documents/projects/somesy/.venv/lib/python3.9/site-packages/codemeta/parsers/python.py", line 223, in                    
         parse_python                                                                                                                                         
             packagename = pkg.name                                                                                                                           
         AttributeError: 'PathDistribution' object has no attribute 'name' 
apirogov commented 1 year ago

This looks like a problem inside codemetapy.

Maybe try running codemetapy as a tool

and see how it behaves / whether it also fails or not.

If it also fails when invoked as CLI tool, then we should figure out what the problem is and evenually open a new issue for codemetapy.

mustafasoylu commented 1 year ago

in solution to #49 I think we will resolve this issue too

mustafasoylu commented 11 months ago

It is not related to #49. Apparently, we solved it somewhere since I can make it work with pida repository.