Fix to_checksums with None values in dicts and recursion
#4579
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#4159 rebased to 5.0x
Having a
'src': Noneentry in a dict for checksums is as valid as having aNoneentry directly in the list. However the current function didn't handle it and crashed.Fix that as well as a few corner cases especially in the recursive case by introducing a new function for handling checksum entries in the checksum list and limiting the recursiveness.
It will now throw an
EasyBuildErrorsimilar to e.g.to_dependencyinstead of trying to continue and fail at a random other place.I extended the testcases to cover the original issue (None as a value in a dict) and some more correct and error cases
Please carefully review and check if you can come up with any valid or invalid
checksumsentry that might break using the new function. Especially regarding the YEB compatibility this was pretty hard as for lists of strings you cannot know if those are 2 checksums without a type that should both match or a checksum and type. In EC-files (Python) one can use a tuple for that but then again it is hard to tell if that tuple is a checksum and type or 2 alternative checksums.Fixes #4142
checksumseasyconfig parameter easybuild-docs#104