You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While extracting metadata from CodeMeta files, there was an issue with finding the file path, leading to this error:
Error while executing codemeta: . contains either no or more than 1 codemeta.json file. Aborting harvesting for this metadata source..
The issue was resolved by adjusting the file path in the _get_single_codemeta function in codemeta.py, which allowed the metadata harvesting to proceed successfully.
I'm not so sure about this. This is clearly supposed to find only a single file and fail if more than one file is found. The codemeta specification doesn't seem to mention where this file is to be placed, so it makes sense to search for it. 🤔 Of course, the error message could be more specific.
(That being said, if someone touches this code, the mentioned line could be simplified to files = path.glob("**/codemeta.json". Then the bits after that need to be changed as well to handle the returned generator object correctly.)
I think the error occurs when installing Hermes in an environment (e.g.: I installed it on the SMECS project) and not cloning the project. I tested both: in the second case, where I harvested from codemeta.json (a test codemeta file which I created to harvest from in the cloned project), it worked fine, but in the first case, there was the mentioned error.
Hello,
While extracting metadata from CodeMeta files, there was an issue with finding the file path, leading to this error:
Error while executing codemeta: . contains either no or more than 1 codemeta.json file. Aborting harvesting for this metadata source.
.The issue was resolved by adjusting the file path in the
_get_single_codemeta
function incodemeta.py
, which allowed the metadata harvesting to proceed successfully.The path was updated as follows:
From:
files = glob.glob(str(path / "**" / "codemeta.json"), recursive=True)
To:
files = glob.glob(str(path / "codemeta.json"), recursive=True)
If this issue is approved, I'm happy to create a pull request and apply the change.
The text was updated successfully, but these errors were encountered: