From 708e131a1c32d58449efa1b0ad0107987733dba2 Mon Sep 17 00:00:00 2001 From: edmondac-admin Date: Fri, 27 Nov 2020 11:49:44 +0000 Subject: [PATCH 1/4] Specifying False for a version removes the dep --- easybuild/framework/easyconfig/easyconfig.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/easybuild/framework/easyconfig/easyconfig.py b/easybuild/framework/easyconfig/easyconfig.py index 3843aa22e1..ee2bb8657c 100644 --- a/easybuild/framework/easyconfig/easyconfig.py +++ b/easybuild/framework/easyconfig/easyconfig.py @@ -702,10 +702,10 @@ def parse(self): # parse dependency specifications # it's important that templating is still disabled at this stage! self.log.info("Parsing dependency specifications...") - self['dependencies'] = [self._parse_dependency(dep) for dep in self['dependencies']] - self['hiddendependencies'] = [ - self._parse_dependency(dep, hidden=True) for dep in self['hiddendependencies'] - ] + deps = [self._parse_dependency(dep) for dep in self['dependencies']] + self['dependencies'] = [x for x in deps if x['version'] is not False] + hiddendeps = [self._parse_dependency(dep, hidden=True) for dep in self['hiddendependencies']] + self['hiddendependencies'] = [x for x in hiddendeps if x['version'] is not False] # need to take into account that builddependencies may need to be iterated over, # i.e. when the value is a list of lists of tuples @@ -715,7 +715,7 @@ def parse(self): builddeps = [[self._parse_dependency(dep, build_only=True) for dep in x] for x in builddeps] else: builddeps = [self._parse_dependency(dep, build_only=True) for dep in builddeps] - self['builddependencies'] = builddeps + self['builddependencies'] = [x for x in builddeps if x['version'] is not False] # keep track of parsed multi deps, they'll come in handy during sanity check & module steps... self.multi_deps = self.get_parsed_multi_deps() From 81bcf138c04767f6351e3ea4f1c4139d58007a7a Mon Sep 17 00:00:00 2001 From: edmondac-admin Date: Fri, 27 Nov 2020 13:35:57 +0000 Subject: [PATCH 2/4] handle different types of dependecy (tuple, dict, ...) --- easybuild/framework/easyconfig/easyconfig.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/easybuild/framework/easyconfig/easyconfig.py b/easybuild/framework/easyconfig/easyconfig.py index ee2bb8657c..d49d63320f 100644 --- a/easybuild/framework/easyconfig/easyconfig.py +++ b/easybuild/framework/easyconfig/easyconfig.py @@ -702,10 +702,17 @@ def parse(self): # parse dependency specifications # it's important that templating is still disabled at this stage! self.log.info("Parsing dependency specifications...") - deps = [self._parse_dependency(dep) for dep in self['dependencies']] - self['dependencies'] = [x for x in deps if x['version'] is not False] - hiddendeps = [self._parse_dependency(dep, hidden=True) for dep in self['hiddendependencies']] - self['hiddendependencies'] = [x for x in hiddendeps if x['version'] is not False] + def remove_false_versions(deps): + ret = [] + for dep in deps: + if isinstance(dep, dict) and dep['version'] == False: + continue + ret.append(dep) + return ret + + self['dependencies'] = remove_false_versions(self._parse_dependency(dep) for dep in self['dependencies']) + self['hiddendependencies'] = remove_false_versions(self._parse_dependency(dep, hidden=True) for dep in + self['hiddendependencies']) # need to take into account that builddependencies may need to be iterated over, # i.e. when the value is a list of lists of tuples @@ -715,7 +722,7 @@ def parse(self): builddeps = [[self._parse_dependency(dep, build_only=True) for dep in x] for x in builddeps] else: builddeps = [self._parse_dependency(dep, build_only=True) for dep in builddeps] - self['builddependencies'] = [x for x in builddeps if x['version'] is not False] + self['builddependencies'] = remove_false_versions(builddeps) # keep track of parsed multi deps, they'll come in handy during sanity check & module steps... self.multi_deps = self.get_parsed_multi_deps() From 11aa3feda36345f699ed9f356385de3737ffbb02 Mon Sep 17 00:00:00 2001 From: edmondac-admin Date: Fri, 27 Nov 2020 13:38:02 +0000 Subject: [PATCH 3/4] tame hound --- easybuild/framework/easyconfig/easyconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/easybuild/framework/easyconfig/easyconfig.py b/easybuild/framework/easyconfig/easyconfig.py index d49d63320f..8195b4fc4e 100644 --- a/easybuild/framework/easyconfig/easyconfig.py +++ b/easybuild/framework/easyconfig/easyconfig.py @@ -702,10 +702,11 @@ def parse(self): # parse dependency specifications # it's important that templating is still disabled at this stage! self.log.info("Parsing dependency specifications...") + def remove_false_versions(deps): ret = [] for dep in deps: - if isinstance(dep, dict) and dep['version'] == False: + if isinstance(dep, dict) and dep['version'] is False: continue ret.append(dep) return ret From 52bc90e85e75c9d312d7223c1931410bac563cc6 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 4 Jan 2021 13:53:21 +0000 Subject: [PATCH 4/4] Update easybuild/framework/easyconfig/easyconfig.py Co-authored-by: Alexander Grund --- easybuild/framework/easyconfig/easyconfig.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/easybuild/framework/easyconfig/easyconfig.py b/easybuild/framework/easyconfig/easyconfig.py index 8195b4fc4e..b826f44382 100644 --- a/easybuild/framework/easyconfig/easyconfig.py +++ b/easybuild/framework/easyconfig/easyconfig.py @@ -704,12 +704,7 @@ def parse(self): self.log.info("Parsing dependency specifications...") def remove_false_versions(deps): - ret = [] - for dep in deps: - if isinstance(dep, dict) and dep['version'] is False: - continue - ret.append(dep) - return ret + return [dep for dep in deps if not (isinstance(dep, dict) and dep['version'] is False)] self['dependencies'] = remove_false_versions(self._parse_dependency(dep) for dep in self['dependencies']) self['hiddendependencies'] = remove_false_versions(self._parse_dependency(dep, hidden=True) for dep in