{"action":"created","issue":{"url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1427","labels_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1427/labels{/name}","comments_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1427/comments","events_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1427/events","html_url":"https://github.com/hpcugent/easybuild-framework/pull/1427","id":111366458,"number":1427,"title":"implement basic support for type checking of easyconfig parameters","user":{"login":"boegel","id":620876,"avatar_url":"https://avatars.githubusercontent.com/u/620876?v=3","gravatar_id":"","url":"https://api.github.com/users/boegel","html_url":"https://github.com/boegel","followers_url":"https://api.github.com/users/boegel/followers","following_url":"https://api.github.com/users/boegel/following{/other_user}","gists_url":"https://api.github.com/users/boegel/gists{/gist_id}","starred_url":"https://api.github.com/users/boegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boegel/subscriptions","organizations_url":"https://api.github.com/users/boegel/orgs","repos_url":"https://api.github.com/users/boegel/repos","events_url":"https://api.github.com/users/boegel/events{/privacy}","received_events_url":"https://api.github.com/users/boegel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/hpcugent/easybuild-framework/milestones/30","html_url":"https://github.com/hpcugent/easybuild-framework/milestones/v2.4.0","labels_url":"https://api.github.com/repos/hpcugent/easybuild-framework/milestones/30/labels","id":1192252,"number":30,"title":"v2.4.0","description":"","creator":{"login":"boegel","id":620876,"avatar_url":"https://avatars.githubusercontent.com/u/620876?v=3","gravatar_id":"","url":"https://api.github.com/users/boegel","html_url":"https://github.com/boegel","followers_url":"https://api.github.com/users/boegel/followers","following_url":"https://api.github.com/users/boegel/following{/other_user}","gists_url":"https://api.github.com/users/boegel/gists{/gist_id}","starred_url":"https://api.github.com/users/boegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boegel/subscriptions","organizations_url":"https://api.github.com/users/boegel/orgs","repos_url":"https://api.github.com/users/boegel/repos","events_url":"https://api.github.com/users/boegel/events{/privacy}","received_events_url":"https://api.github.com/users/boegel/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":19,"state":"open","created_at":"2015-07-03T10:24:57Z","updated_at":"2015-10-14T10:12:33Z","due_on":"2015-10-30T23:00:00Z","closed_at":null},"comments":1,"created_at":"2015-10-14T10:12:33Z","updated_at":"2015-10-14T10:12:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hpcugent/easybuild-framework/pulls/1427","html_url":"https://github.com/hpcugent/easybuild-framework/pull/1427","diff_url":"https://github.com/hpcugent/easybuild-framework/pull/1427.diff","patch_url":"https://github.com/hpcugent/easybuild-framework/pull/1427.patch"},"body":"Without type checking, you can run into nasty errors, for example the one below when using a non-string value for the `version` easyconfig parameter:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/main.py\", line 361, in <module>\r\n    main()\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/main.py\", line 276, in main\r\n    easyconfigs, generated_ecs = parse_easyconfigs(paths)\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/framework/easyconfig/tools.py\", line 345, in parse_easyconfigs\r\n    ecs = process_easyconfig(ec_file, **kwargs)\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py\", line 943, in process_easyconfig\r\n    ec = EasyConfig(spec, build_specs=build_specs, validate=validate, hidden=hidden)\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py\", line 188, in __init__\r\n    self.parse()\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py\", line 296, in parse\r\n    self.generate_template_values()\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py\", line 661, in generate_template_values\r\n    self._generate_template_values(skip_lower=True)\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py\", line 675, in _generate_template_values\r\n    ignore=ignore, skip_lower=skip_lower)\r\n  File \"/Users/kehoste/work/easybuild-framework/easybuild/framework/easyconfig/templates.py\", line 161, in template_constant_dict\r\n    version = LooseVersion(version).version\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/version.py\", line 265, in __init__\r\n    self.parse(vstring)\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/version.py\", line 274, in parse\r\n    self.component_re.split(vstring))\r\nTypeError: expected string or buffer\r\n```\r\n\r\nWith these changes in place, you'll get this instead:\r\n\r\n```\r\nEasyBuildError: \"Failed to process easyconfig example.eb: Type checking of easyconfig parameter values failed: value for 'version' should be of type 'basestring'\"\r\n```\r\n\r\nThis implementation is intended as a starting point, since only the values for `name`/`version` will be type-checked for now.\r\nComplex values like `sanity_check_paths` will need additional logic/functionality, and support for automatically trying to convert values is probably worthwhile too. For example, with easyconfig files in YAML syntax (see #1407), a value for `version` like `1.6` would be parsed as `float` by default, although it should be a string value..."},"comment":{"url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/comments/148002693","html_url":"https://github.com/hpcugent/easybuild-framework/pull/1427#issuecomment-148002693","issue_url":"https://api.github.com/repos/hpcugent/easybuild-framework/issues/1427","id":148002693,"user":{"login":"boegel","id":620876,"avatar_url":"https://avatars.githubusercontent.com/u/620876?v=3","gravatar_id":"","url":"https://api.github.com/users/boegel","html_url":"https://github.com/boegel","followers_url":"https://api.github.com/users/boegel/followers","following_url":"https://api.github.com/users/boegel/following{/other_user}","gists_url":"https://api.github.com/users/boegel/gists{/gist_id}","starred_url":"https://api.github.com/users/boegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boegel/subscriptions","organizations_url":"https://api.github.com/users/boegel/orgs","repos_url":"https://api.github.com/users/boegel/repos","events_url":"https://api.github.com/users/boegel/events{/privacy}","received_events_url":"https://api.github.com/users/boegel/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T10:12:43Z","updated_at":"2015-10-14T10:12:43Z","body":"@wpoely86, @Caylo: please review?"}}