|
61 | 61 | from easybuild.framework.easyconfig.style import MAX_LINE_LENGTH |
62 | 62 | from easybuild.framework.easyconfig.tools import get_paths_for |
63 | 63 | from easybuild.framework.easyconfig.templates import TEMPLATE_NAMES_EASYBLOCK_RUN_STEP, template_constant_dict |
64 | | -from easybuild.framework.extension import resolve_exts_filter_template |
| 64 | +from easybuild.framework.extension import Extension, resolve_exts_filter_template |
65 | 65 | from easybuild.tools import config, run |
66 | 66 | from easybuild.tools.build_details import get_build_stats |
67 | 67 | from easybuild.tools.build_log import EasyBuildError, dry_run_msg, dry_run_warning, dry_run_set_dirs |
@@ -2317,8 +2317,13 @@ def init_ext_instances(self): |
2317 | 2317 | # with a similar name (e.g., Perl Extension 'GO' vs 'Go' for which 'EB_Go' is available) |
2318 | 2318 | cls = get_easyblock_class(easyblock, name=ext_name, error_on_failed_import=False, |
2319 | 2319 | error_on_missing_easyblock=False) |
| 2320 | + |
2320 | 2321 | self.log.debug("Obtained class %s for extension %s", cls, ext_name) |
2321 | 2322 | if cls is not None: |
| 2323 | + # make sure that this easyblock can be used to install extensions |
| 2324 | + if not issubclass(cls, Extension): |
| 2325 | + raise EasyBuildError("%s easyblock can not be used to install extensions!", cls.__name__) |
| 2326 | + |
2322 | 2327 | inst = cls(self, ext) |
2323 | 2328 | except (ImportError, NameError) as err: |
2324 | 2329 | self.log.debug("Failed to use extension-specific class for extension %s: %s", ext_name, err) |
|
0 commit comments