Repository: easybuilders/easybuild-framework

Issue:
Build-dependencies cannot use the `Name: version` syntax [yeb]
This abridged syntax is accepted by `dependencies:` in `.yeb` files::

```
    dependencies:
      - Autoconf: 2.69
```

However, the same syntax is _not_ accepted in the `builddependencies`
(and possibly other) sections; EB errors out:

```
    ERROR: Failed to process easyconfig /net/nfs4/nfs.hydra/home/rmurri/givaro.yeb: Dependency specified without name: {'external_module_metadata': {}, 'full_mod_name': None, 'build_only': True, 'versionsuffix': '', 'external_module': False, 'dummy': False, 'Autoconf': 2.69, 'toolchain': {'version': '2015a', 'name': 'foss'}, 'name': None, 'short_mod_name': None, 'version': None, 'hidden': False}
```



Discussion:

Resolving patch:
diff --git a/easybuild/framework/easyconfig/types.py b/easybuild/framework/easyconfig/types.py
--- a/easybuild/framework/easyconfig/types.py
+++ b/easybuild/framework/easyconfig/types.py
@@ -32,7 +32,7 @@
 from vsc.utils import fancylogger
 
 from easybuild.tools.build_log import EasyBuildError
-
+from easybuild.framework.easyconfig.format.format import DEPENDENCY_PARAMETERS
 
 _log = fancylogger.getLogger('easyconfig.types', fname=False)
 
@@ -348,7 +348,6 @@ def to_dependency(dep):
     """
     # deal with dependencies coming for .eb easyconfig, typically in tuple format:
     #   (name, version[, versionsuffix[, toolchain]])
-
     if isinstance(dep, dict):
         depspec = {}
 
@@ -369,11 +368,11 @@ def to_dependency(dep):
             found_name_version = False
             for key, value in dep.items():
                 if key in ['name', 'version', 'versionsuffix']:
-                    depspec[key] = value
+                    depspec[key] = str(value)
                 elif key == 'toolchain':
                     depspec['toolchain'] = to_name_version_dict(value)
                 elif not found_name_version:
-                    depspec.update({'name': key, 'version': value})
+                    depspec.update({'name': key, 'version': str(value)})
                 else:
                     raise EasyBuildError("Found unexpected (key, value) pair: %s, %s", key, value)
 
@@ -442,13 +441,15 @@ def to_dependencies(dep_list):
 
 # type checking is skipped for easyconfig parameters names not listed in PARAMETER_TYPES
 PARAMETER_TYPES = {
-    'dependencies': DEPENDENCIES,
     'name': basestring,
     'osdependencies': STRING_OR_TUPLE_LIST,
     'sanity_check_paths': SANITY_CHECK_PATHS_DICT,
     'toolchain': NAME_VERSION_DICT,
     'version': basestring,
 }
+# add all dependency types as dependencies
+for dep in DEPENDENCY_PARAMETERS:
+    PARAMETER_TYPES[dep] = DEPENDENCIES
 
 TYPE_CONVERSION_FUNCTIONS = {
     basestring: str,


Test patch:
diff --git a/test/framework/easyconfigs/bzip2-1.0.6-GCC-4.9.2.eb b/test/framework/easyconfigs/bzip2-1.0.6-GCC-4.9.2.eb
--- a/test/framework/easyconfigs/bzip2-1.0.6-GCC-4.9.2.eb
+++ b/test/framework/easyconfigs/bzip2-1.0.6-GCC-4.9.2.eb
@@ -15,4 +15,6 @@ toolchainopts = {'pic': True}
 sources = [SOURCE_TAR_GZ]
 source_urls = ['http://www.bzip.org/%(version)s']
 
+builddependencies = [('gzip', '1.6')]
+
 moduleclass = 'tools'
diff --git a/test/framework/easyconfigs/yeb/bzip2-1.0.6-GCC-4.9.2.yeb b/test/framework/easyconfigs/yeb/bzip2-1.0.6-GCC-4.9.2.yeb
--- a/test/framework/easyconfigs/yeb/bzip2-1.0.6-GCC-4.9.2.yeb
+++ b/test/framework/easyconfigs/yeb/bzip2-1.0.6-GCC-4.9.2.yeb
@@ -22,4 +22,7 @@ sources:
 source_urls:
     - http://www.bzip.org/%(version)s
 
+builddependencies:
+    - gzip: 1.6
+
 moduleclass: tools