File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
easybuild/tools/module_naming_scheme Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -64,16 +64,16 @@ def det_full_ec_version(ec):
6464
6565 # prepend/append version prefix/suffix
6666 versionprefix = ec .get ('versionprefix' , '' )
67- if not isinstance (versionprefix , string_type ):
67+ if versionprefix and not isinstance (versionprefix , string_type ):
6868 raise EasyBuildError ("versionprefix value should be a string, found '%s': %s (full spec: %s)" ,
6969 type (versionprefix ).__name__ , versionprefix , ec )
7070
7171 versionsuffix = ec .get ('versionsuffix' , '' )
72- if not isinstance (versionsuffix , string_type ):
72+ if versionsuffix and not isinstance (versionsuffix , string_type ):
7373 raise EasyBuildError ("versionsuffix value should be a string, found '%s': %s (full spec: %s)" ,
7474 type (versionsuffix ).__name__ , versionsuffix , ec )
7575
76- ecver = '' .join ([x for x in [versionprefix , ecver , versionsuffix ] if x ])
76+ ecver = '' .join ([x for x in [versionprefix or '' , ecver , versionsuffix or '' ] if x ])
7777
7878 return ecver
7979
Original file line number Diff line number Diff line change @@ -761,6 +761,12 @@ def test_installversion(self):
761761 # only version key is strictly needed
762762 self .assertEqual (det_full_ec_version ({'version' : '1.2.3' }), '1.2.3' )
763763
764+ # versionprefix/versionsuffix can also be set to None,
765+ # see https://github.com/easybuilders/easybuild-framework/issues/4281
766+ cfg ['versionprefix' ] = None
767+ cfg ['versionsuffix' ] = None
768+ self .assertEqual (det_full_ec_version (cfg ), '3.14' )
769+
764770 # check how faulty dep spec is handled
765771 faulty_dep_spec = {
766772 'name' : 'test' ,
You can’t perform that action at this time.
0 commit comments