diff --git a/easybuild/framework/easyconfig/types.py b/easybuild/framework/easyconfig/types.py index 76a837a7e8..b0f6107662 100644 --- a/easybuild/framework/easyconfig/types.py +++ b/easybuild/framework/easyconfig/types.py @@ -563,19 +563,28 @@ def ensure_iterable_license_specs(specs): })) # checksums is a list of checksums, one entry per file (source/patch) # each entry can be: +# None # a single checksum value (string) # a single checksum value of a specified type (2-tuple, 1st element is checksum type, 2nd element is checksum) -# a list of checksums (of different types, perhaps different formats), which should *all* be valid -# a dictionary with a mapping from filename to checksum value -CHECKSUM_LIST = (list, as_hashable({'elem_types': [str, tuple, STRING_DICT]})) -CHECKSUMS = (list, as_hashable({'elem_types': [str, tuple, STRING_DICT, CHECKSUM_LIST]})) +# a tuple of checksums (of different types, perhaps different formats), which should *all* be valid +# a dictionary with a mapping from filename to checksum (None, value, type&value, alternatives) +# +# For simplicity we only allow the case(s) where the tuple consists only of strings +# and leave further verification to the to_checksums function +CHECKSUM_DICT = (dict, as_hashable( + { + 'elem_types': [type(None), str, TUPLE_OF_STRINGS], + 'key_types': [str], + } +)) +CHECKSUMS = (list, as_hashable({'elem_types': [type(None), str, TUPLE_OF_STRINGS, CHECKSUM_DICT]})) -CHECKABLE_TYPES = [CHECKSUM_LIST, CHECKSUMS, DEPENDENCIES, DEPENDENCY_DICT, LIST_OF_STRINGS, +CHECKABLE_TYPES = [CHECKSUM_DICT, CHECKSUMS, DEPENDENCIES, DEPENDENCY_DICT, LIST_OF_STRINGS, SANITY_CHECK_PATHS_DICT, STRING_DICT, STRING_OR_TUPLE_LIST, STRING_OR_TUPLE_OR_DICT_LIST, TOOLCHAIN_DICT, TUPLE_OF_STRINGS] # easy types, that can be verified with isinstance -EASY_TYPES = [string_type, bool, dict, int, list, str, tuple] +EASY_TYPES = [string_type, bool, dict, int, list, str, tuple, type(None)] # type checking is skipped for easyconfig parameters names not listed in PARAMETER_TYPES PARAMETER_TYPES = {