예제 #1
0
                'package_type') == PKG_TYPE_RPM:
            rpmbuild_path = which('rpmbuild')
            if rpmbuild_path:
                _log.info("Required tool 'rpmbuild' found at %s",
                          rpmbuild_path)
            else:
                raise EasyBuildError(
                    "rpmbuild is required when generating RPM packages but was not found"
                )

    else:
        raise EasyBuildError("Selected packaging tool '%s' not found", pkgtool)


# singleton metaclass: only one instance is created
BaseActivePNS = create_base_metaclass('BaseActivePNS', Singleton, object)


class ActivePNS(BaseActivePNS):
    """
    The wrapper class for Package Naming Schemes.
    """
    def __init__(self):
        """Initialize logger and find available PNSes to load"""
        self.log = fancylogger.getLogger(self.__class__.__name__, fname=False)

        avail_pns = avail_package_naming_schemes()
        sel_pns = get_package_naming_scheme()
        if sel_pns in avail_pns:
            self.pns = avail_pns[sel_pns]()
        else:
예제 #2
0
Module naming scheme API.

:author: Jens Timmerman (Ghent University)
:author: Kenneth Hoste (Ghent University)
"""
import re

from easybuild.base import fancylogger
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.config import Singleton
from easybuild.tools.py2vs3 import create_base_metaclass

DEVEL_MODULE_SUFFIX = '-easybuild-devel'

# singleton metaclass: only one instance is created
BaseModuleNamingScheme = create_base_metaclass('BaseModuleNamingScheme',
                                               Singleton, object)


class ModuleNamingScheme(BaseModuleNamingScheme):
    """Abstract class for a module naming scheme implementation."""

    REQUIRED_KEYS = None

    def __init__(self, *args, **kwargs):
        """Initialize logger."""
        self.log = fancylogger.getLogger(self.__class__.__name__, fname=False)

    def is_sufficient(self, keys):
        """Determine whether specified list of easyconfig parameters is sufficient for this module naming scheme."""
        if self.REQUIRED_KEYS is not None:
            return set(keys).issuperset(set(self.REQUIRED_KEYS))
예제 #3
0
    ('lib', "General purpose libraries"),
    ('math', "High-level mathematical software"),
    ('mpi', "MPI stacks"),
    ('numlib', "Numerical Libraries"),
    ('perf', "Performance tools"),
    ('quantum', "Quantum Computing"),
    ('phys', "Physics and physical systems simulations"),
    ('system',
     "System utilities (e.g. highly depending on system OS and hardware)"),
    ('toolchain', "EasyBuild toolchains"),
    ('tools', "General purpose tools"),
    ('vis', "Visualization, plotting, documentation and typesetting"),
]

# singleton metaclass: only one instance is created
BaseConfigurationVariables = create_base_metaclass(
    'BaseConfigurationVariables', Singleton, FrozenDictKnownKeys)


class ConfigurationVariables(BaseConfigurationVariables):
    """This is a dict that supports legacy config names transparently."""

    # list of known/required keys
    REQUIRED = [
        'buildpath',
        'config',
        'containerpath',
        'installpath',
        'installpath_modules',
        'installpath_software',
        'job_backend',
        'logfile_format',