packages : moved decorators into AutotoolsPackage and CMakePackage
This commit is contained in:
@@ -1733,6 +1733,16 @@ def build(self, spec, prefix):
|
||||
def install(self, spec, prefix):
|
||||
inspect.getmodule(self).make('install')
|
||||
|
||||
@PackageBase.sanity_check('build')
|
||||
@PackageBase.on_package_attributes(run_tests=True)
|
||||
def _run_default_function(self):
|
||||
try:
|
||||
fn = getattr(self, 'check')
|
||||
tty.msg('Trying default sanity checks [check]')
|
||||
fn()
|
||||
except AttributeError:
|
||||
tty.msg('Skipping default sanity checks [method `check` not implemented]') # NOQA: ignore=E501
|
||||
|
||||
# This will be used as a registration decorator in user
|
||||
# packages, if need be
|
||||
PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)
|
||||
@@ -1792,6 +1802,16 @@ def install(self, spec, prefix):
|
||||
with working_dir(self.wdir()):
|
||||
inspect.getmodule(self).make('install')
|
||||
|
||||
@PackageBase.sanity_check('build')
|
||||
@PackageBase.on_package_attributes(run_tests=True)
|
||||
def _run_default_function(self):
|
||||
try:
|
||||
fn = getattr(self, 'check')
|
||||
tty.msg('Trying default sanity checks [check]')
|
||||
fn()
|
||||
except AttributeError:
|
||||
tty.msg('Skipping default sanity checks [method `check` not implemented]') # NOQA: ignore=E501
|
||||
|
||||
PackageBase.sanity_check('install')(PackageBase.sanity_check_prefix)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user