Skip to content

Commit

Permalink
Merge pull request #3506 from bear-rsg/disable-dep-with-version-false
Browse files Browse the repository at this point in the history
Specifying False for a version removes the dep
  • Loading branch information
akesandgren authored Feb 22, 2021
2 parents 21b1a70 + 52bc90e commit 95442b4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,13 @@ 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']
]

def remove_false_versions(deps):
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
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
Expand All @@ -715,7 +718,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'] = 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()
Expand Down

0 comments on commit 95442b4

Please sign in to comment.