Repository: easybuilders/easybuild-framework

Issue:
Regression with versionsuffix types
Commit https://github.com/easybuilders/easybuild-framework/commit/0e5ba5c858
introduced a check for string-type for `versionsuffix`, while `None` used to be an accepted value for `versionsuffix`. Our hooks replace many version suffixes with `None`. 


Discussion:
Interestingly every falsy value was accepted. So next to empty string and `None` also `False` or an empty list.
I don't see how anything but string and `None` make sense here

So might be ok to break a potential abuse and only allow `None` next to the string type.

However the dependency dictionary spec  converts a `versionsuffix` unconditionally into a string: https://github.com/easybuilders/easybuild-framework/blob/cef915b150065c1cb25f8dee07104081f0b1b7ae/easybuild/framework/easyconfig/types.py#L477-L478

So when there `versionSuffix: None` is used the result will be `"None"`, so maybe we should keep this small breaking change as the error message is very clear and replacing the hook to use an empty string works always.
In the immediate, I will just hot-fix our copy of framework to remove that check (or allow None)
https://github.com/ComputeCanada/easybuild-framework/commit/59d2f54bdcdfe06afe5574d9d28d40b929cdbfb1

Resolving patch:
diff --git a/easybuild/tools/module_naming_scheme/utilities.py b/easybuild/tools/module_naming_scheme/utilities.py
--- a/easybuild/tools/module_naming_scheme/utilities.py
+++ b/easybuild/tools/module_naming_scheme/utilities.py
@@ -64,16 +64,16 @@ def det_full_ec_version(ec):
 
     # prepend/append version prefix/suffix
     versionprefix = ec.get('versionprefix', '')
-    if not isinstance(versionprefix, string_type):
+    if versionprefix and not isinstance(versionprefix, string_type):
         raise EasyBuildError("versionprefix value should be a string, found '%s': %s (full spec: %s)",
                              type(versionprefix).__name__, versionprefix, ec)
 
     versionsuffix = ec.get('versionsuffix', '')
-    if not isinstance(versionsuffix, string_type):
+    if versionsuffix and not isinstance(versionsuffix, string_type):
         raise EasyBuildError("versionsuffix value should be a string, found '%s': %s (full spec: %s)",
                              type(versionsuffix).__name__, versionsuffix, ec)
 
-    ecver = ''.join([x for x in [versionprefix, ecver, versionsuffix] if x])
+    ecver = ''.join([x for x in [versionprefix or '', ecver, versionsuffix or ''] if x])
 
     return ecver
 


Test patch:
diff --git a/test/framework/easyconfig.py b/test/framework/easyconfig.py
--- a/test/framework/easyconfig.py
+++ b/test/framework/easyconfig.py
@@ -761,6 +761,12 @@ def test_installversion(self):
         # only version key is strictly needed
         self.assertEqual(det_full_ec_version({'version': '1.2.3'}), '1.2.3')
 
+        # versionprefix/versionsuffix can also be set to None,
+        # see https://github.com/easybuilders/easybuild-framework/issues/4281
+        cfg['versionprefix'] = None
+        cfg['versionsuffix'] = None
+        self.assertEqual(det_full_ec_version(cfg), '3.14')
+
         # check how faulty dep spec is handled
         faulty_dep_spec = {
             'name': 'test',