|
68 | 68 | from easybuild.tools.module_naming_scheme.utilities import det_hidden_modname, is_valid_module_name |
69 | 69 | from easybuild.tools.modules import modules_tool |
70 | 70 | from easybuild.tools.py2vs3 import OrderedDict, create_base_metaclass, string_type |
71 | | -from easybuild.tools.systemtools import check_os_dependency, get_cpu_architecture |
| 71 | +from easybuild.tools.systemtools import check_os_dependency, pick_dep_version |
72 | 72 | from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME, is_system_toolchain |
73 | 73 | from easybuild.tools.toolchain.toolchain import TOOLCHAIN_CAPABILITIES, TOOLCHAIN_CAPABILITY_CUDA |
74 | 74 | from easybuild.tools.toolchain.utilities import get_toolchain, search_toolchain |
@@ -1231,31 +1231,6 @@ def get_parsed_multi_deps(self): |
1231 | 1231 |
|
1232 | 1232 | return multi_deps |
1233 | 1233 |
|
1234 | | - def find_dep_version_match(self, dep_version): |
1235 | | - """Identify the correct version for this system from the choices provided. This returns the version to use.""" |
1236 | | - if isinstance(dep_version, string_type): |
1237 | | - self.log.debug("Version is already a string ('%s'), OK", dep_version) |
1238 | | - return dep_version |
1239 | | - elif dep_version is None: |
1240 | | - self.log.debug("Version is None, OK") |
1241 | | - return None |
1242 | | - elif isinstance(dep_version, dict): |
1243 | | - # figure out matches based on dict keys (after splitting on '=') |
1244 | | - my_arch_key = 'arch=%s' % get_cpu_architecture() |
1245 | | - arch_keys = [x for x in dep_version.keys() if x.startswith('arch=')] |
1246 | | - other_keys = [x for x in dep_version.keys() if x not in arch_keys] |
1247 | | - if other_keys: |
1248 | | - raise EasyBuildError("Unexpected keys in version: %s. Only 'arch=' keys are supported", other_keys) |
1249 | | - if arch_keys: |
1250 | | - if my_arch_key in dep_version: |
1251 | | - ver = dep_version[my_arch_key] |
1252 | | - self.log.info("Version selected from %s using key %s: %s", dep_version, my_arch_key, ver) |
1253 | | - return ver |
1254 | | - else: |
1255 | | - raise EasyBuildError("No matches for version in %s (looking for %s)", dep_version, my_arch_key) |
1256 | | - |
1257 | | - raise EasyBuildError("Unknown value type for version: %s", dep_version) |
1258 | | - |
1259 | 1234 | # private method |
1260 | 1235 | def _parse_dependency(self, dep, hidden=False, build_only=False): |
1261 | 1236 | """ |
@@ -1337,7 +1312,7 @@ def _parse_dependency(self, dep, hidden=False, build_only=False): |
1337 | 1312 | raise EasyBuildError("Dependency %s of unsupported type: %s", dep, type(dep)) |
1338 | 1313 |
|
1339 | 1314 | # Find the version to use on this system |
1340 | | - dependency['version'] = self.find_dep_version_match(dependency['version']) |
| 1315 | + dependency['version'] = pick_dep_version(dependency['version']) |
1341 | 1316 |
|
1342 | 1317 | if dependency['external_module']: |
1343 | 1318 | # check whether the external module is hidden |
|
0 commit comments