Skip to content

Commit

Permalink
Allow patches to be dicts.
Browse files Browse the repository at this point in the history
Add STRING_OR_TUPLE_OR_DICT_LIST for testing validity of "patches" format.
Required to make PR# 3994 complete.
  • Loading branch information
akesandgren committed Aug 30, 2022
1 parent a8c0cad commit 0349826
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions easybuild/framework/easyconfig/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def ensure_iterable_license_specs(specs):
'key_types': [str],
}
))
STRING_OR_TUPLE_OR_DICT_LIST = (list, as_hashable({'elem_types': [str, TUPLE_OF_STRINGS, STRING_DICT]}))
SANITY_CHECK_PATHS_DICT = (dict, as_hashable({
'elem_types': {
SANITY_CHECK_PATHS_FILES: [STRING_OR_TUPLE_LIST],
Expand All @@ -544,7 +545,8 @@ def ensure_iterable_license_specs(specs):
CHECKSUMS = (list, as_hashable({'elem_types': [str, tuple, STRING_DICT, CHECKSUM_LIST]}))

CHECKABLE_TYPES = [CHECKSUM_LIST, CHECKSUMS, DEPENDENCIES, DEPENDENCY_DICT, LIST_OF_STRINGS,
SANITY_CHECK_PATHS_DICT, STRING_DICT, STRING_OR_TUPLE_LIST, TOOLCHAIN_DICT, TUPLE_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]
Expand All @@ -555,7 +557,7 @@ def ensure_iterable_license_specs(specs):
'docurls': LIST_OF_STRINGS,
'name': string_type,
'osdependencies': STRING_OR_TUPLE_LIST,
'patches': STRING_OR_TUPLE_LIST,
'patches': STRING_OR_TUPLE_OR_DICT_LIST,
'sanity_check_paths': SANITY_CHECK_PATHS_DICT,
'toolchain': TOOLCHAIN_DICT,
'version': string_type,
Expand Down

0 comments on commit 0349826

Please sign in to comment.