本文整理汇总了Python中easybuild.framework.extensioneasyblock.ExtensionEasyBlock.extra_options方法的典型用法代码示例。如果您正苦于以下问题:Python ExtensionEasyBlock.extra_options方法的具体用法?Python ExtensionEasyBlock.extra_options怎么用?Python ExtensionEasyBlock.extra_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类easybuild.framework.extensioneasyblock.ExtensionEasyBlock
的用法示例。
在下文中一共展示了ExtensionEasyBlock.extra_options方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options(extra_vars=None):
"""Extra easyconfig parameters specific to RPackage."""
extra_vars = ExtensionEasyBlock.extra_options(extra_vars=extra_vars)
extra_vars.update({
'unpack_sources': [False, "Unpack sources before installation", CUSTOM],
})
return extra_vars
示例2: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options(extra_vars=None):
"""Extra easyconfig parameters specific to RPackage."""
extra_vars = ExtensionEasyBlock.extra_options(extra_vars=extra_vars)
extra_vars.update({
'exts_subdir': ['', "Subdirectory where R extensions should be installed info", CUSTOM],
'unpack_sources': [False, "Unpack sources before installation", CUSTOM],
})
return extra_vars
示例3: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options(extra_vars=None):
"""Easyconfig parameters specific to Python packages."""
if extra_vars is None:
extra_vars = {}
extra_vars.update({
'runtest': [True, "Run unit tests.", CUSTOM], # overrides default
'use_easy_install': [False, "Install using '%s'" % EASY_INSTALL_CMD, CUSTOM],
'zipped_egg': [False, "Install as a zipped eggs (requires use_easy_install)", CUSTOM],
})
return ExtensionEasyBlock.extra_options(extra_vars=extra_vars)
示例4: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options(extra_vars=None):
"""Easyconfig parameters specific to Python packages."""
if extra_vars is None:
extra_vars = {}
extra_vars.update({
'unpack_sources': [True, "Unpack sources prior to build/install", CUSTOM],
'req_py_majver': [2, "Required major Python version (only relevant when using system Python)", CUSTOM],
'req_py_minver': [6, "Required minor Python version (only relevant when using system Python)", CUSTOM],
'runtest': [True, "Run unit tests.", CUSTOM], # overrides default
'use_easy_install': [False, "Install using '%s'" % EASY_INSTALL_INSTALL_CMD, CUSTOM],
'use_pip': [False, "Install using '%s'" % PIP_INSTALL_CMD, CUSTOM],
'zipped_egg': [False, "Install as a zipped eggs (requires use_easy_install)", CUSTOM],
})
return ExtensionEasyBlock.extra_options(extra_vars=extra_vars)
示例5: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options(extra_vars=None):
"""Easyconfig parameters specific to Python packages."""
if extra_vars is None:
extra_vars = {}
extra_vars.update({
'unpack_sources': [True, "Unpack sources prior to build/install", CUSTOM],
'req_py_majver': [2, "Required major Python version (only relevant when using system Python)", CUSTOM],
'req_py_minver': [6, "Required minor Python version (only relevant when using system Python)", CUSTOM],
'runtest': [True, "Run unit tests.", CUSTOM], # overrides default
'use_easy_install': [False, "Install using '%s' (deprecated)" % EASY_INSTALL_INSTALL_CMD, CUSTOM],
'use_pip': [False, "Install using '%s'" % PIP_INSTALL_CMD, CUSTOM],
'use_pip_for_deps': [False, "Install dependencies using '%s'" % PIP_INSTALL_CMD, CUSTOM],
'use_setup_py_develop': [False, "Install using '%s' (deprecated)" % SETUP_PY_DEVELOP_CMD, CUSTOM],
'zipped_egg': [False, "Install as a zipped eggs (requires use_easy_install)", CUSTOM],
'buildcmd': ['build', "Command to pass to setup.py to build the extension", CUSTOM],
'install_target': ['install', "Option to pass to setup.py", CUSTOM],
})
return ExtensionEasyBlock.extra_options(extra_vars=extra_vars)
示例6: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options():
"""Easyconfig parameters specific to Perl modules."""
extra_vars = {
'runtest': ['test', "Run unit tests.", CUSTOM], # overrides default
}
return ExtensionEasyBlock.extra_options(extra_vars)
示例7: test_easyblock
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def test_easyblock(self):
""" make sure easyconfigs defining extensions work"""
def check_extra_options_format(extra_options):
"""Make sure extra_options value is of correct format."""
# EasyBuild v2.0: dict with <string> keys and <list> values
# (breaks backward compatibility compared to v1.x)
self.assertTrue(isinstance(extra_options, dict)) # conversion to a dict works
extra_options.items()
extra_options.keys()
extra_options.values()
for key in extra_options.keys():
self.assertTrue(isinstance(extra_options[key], list))
self.assertTrue(len(extra_options[key]), 3)
name = "pi"
version = "3.14"
self.contents = '\n'.join([
'easyblock = "ConfigureMake"',
'name = "%s"' % name,
'version = "%s"' % version,
'homepage = "http://example.com"',
'description = "test easyconfig"',
'toolchain = {"name":"dummy", "version": "dummy"}',
'exts_list = ["ext1"]',
])
self.writeEC()
stdoutorig = sys.stdout
sys.stdout = open("/dev/null", 'w')
ec = EasyConfig(self.eb_file)
eb = EasyBlock(ec)
self.assertEqual(eb.cfg['name'], name)
self.assertEqual(eb.cfg['version'], version)
self.assertRaises(NotImplementedError, eb.run_all_steps, True)
check_extra_options_format(eb.extra_options())
sys.stdout.close()
sys.stdout = stdoutorig
# check whether 'This is easyblock' log message is there
tup = ('EasyBlock', 'easybuild.framework.easyblock', '.*easybuild/framework/easyblock.pyc*')
eb_log_msg_re = re.compile(r"INFO This is easyblock %s from module %s (%s)" % tup, re.M)
logtxt = read_file(eb.logfile)
self.assertTrue(eb_log_msg_re.search(logtxt), "Pattern '%s' found in: %s" % (eb_log_msg_re.pattern, logtxt))
# test extensioneasyblock, as extension
exeb1 = ExtensionEasyBlock(eb, {'name': 'foo', 'version': '0.0'})
self.assertEqual(exeb1.cfg['name'], 'foo')
extra_options = exeb1.extra_options()
check_extra_options_format(extra_options)
self.assertTrue('options' in extra_options)
# test extensioneasyblock, as easyblock
exeb2 = ExtensionEasyBlock(ec)
self.assertEqual(exeb2.cfg['name'], 'pi')
self.assertEqual(exeb2.cfg['version'], '3.14')
extra_options = exeb2.extra_options()
check_extra_options_format(extra_options)
self.assertTrue('options' in extra_options)
class TestExtension(ExtensionEasyBlock):
@staticmethod
def extra_options():
return ExtensionEasyBlock.extra_options({'extra_param': [None, "help", CUSTOM]})
texeb = TestExtension(eb, {'name': 'bar'})
self.assertEqual(texeb.cfg['name'], 'bar')
extra_options = texeb.extra_options()
check_extra_options_format(extra_options)
self.assertTrue('options' in extra_options)
self.assertEqual(extra_options['extra_param'], [None, "help", CUSTOM])
# cleanup
eb.close_log()
os.remove(eb.logfile)
示例8: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options():
return ExtensionEasyBlock.extra_options({'extra_param': [None, "help", CUSTOM]})
示例9: test_easyblock
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def test_easyblock(self):
""" make sure easyconfigs defining extensions work"""
def check_extra_options_format(extra_options):
"""Make sure extra_options value is of correct format."""
# EasyBuild v1.x
self.assertTrue(isinstance(extra_options, list))
for extra_option in extra_options:
self.assertTrue(isinstance(extra_option, tuple))
self.assertEqual(len(extra_option), 2)
self.assertTrue(isinstance(extra_option[0], basestring))
self.assertTrue(isinstance(extra_option[1], list))
self.assertEqual(len(extra_option[1]), 3)
# EasyBuild v2.0 (breaks backward compatibility compared to v1.x)
#self.assertTrue(isinstance(extra_options, dict))
#for key in extra_options:
# self.assertTrue(isinstance(extra_options[key], list))
# self.assertTrue(len(extra_options[key]), 3)
name = "pi"
version = "3.14"
self.contents = '\n'.join([
'name = "%s"' % name,
'version = "%s"' % version,
'homepage = "http://example.com"',
'description = "test easyconfig"',
'toolchain = {"name":"dummy", "version": "dummy"}',
'exts_list = ["ext1"]',
])
self.writeEC()
stdoutorig = sys.stdout
sys.stdout = open("/dev/null", 'w')
ec = EasyConfig(self.eb_file)
eb = EasyBlock(ec)
self.assertEqual(eb.cfg['name'], name)
self.assertEqual(eb.cfg['version'], version)
self.assertRaises(NotImplementedError, eb.run_all_steps, True)
check_extra_options_format(eb.extra_options())
sys.stdout.close()
sys.stdout = stdoutorig
# test extensioneasyblock, as extension
exeb1 = ExtensionEasyBlock(eb, {'name': 'foo', 'version': '0.0'})
self.assertEqual(exeb1.cfg['name'], 'foo')
extra_options = exeb1.extra_options()
check_extra_options_format(extra_options)
self.assertTrue('options' in [key for (key, _) in extra_options])
# test extensioneasyblock, as easyblock
exeb2 = ExtensionEasyBlock(ec)
self.assertEqual(exeb2.cfg['name'], 'pi')
self.assertEqual(exeb2.cfg['version'], '3.14')
extra_options = exeb2.extra_options()
check_extra_options_format(extra_options)
self.assertTrue('options' in [key for (key, _) in extra_options])
class TestExtension(ExtensionEasyBlock):
@staticmethod
def extra_options():
return ExtensionEasyBlock.extra_options([('extra_param', [None, "help", CUSTOM])])
texeb = TestExtension(eb, {'name': 'bar'})
self.assertEqual(texeb.cfg['name'], 'bar')
extra_options = texeb.extra_options()
check_extra_options_format(extra_options)
self.assertTrue('options' in [key for (key, _) in extra_options])
self.assertEqual([val for (key, val) in extra_options if key == 'extra_param'][0], [None, "help", CUSTOM])
# cleanup
eb.close_log()
os.remove(eb.logfile)
示例10: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options():
return ExtensionEasyBlock.extra_options([('extra_param', [None, "help", CUSTOM])])
示例11: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options():
"""Easyconfig parameters specific to Python packages."""
extra_vars = [
('runtest', [True, "Run unit tests.", CUSTOM]), # overrides default
]
return ExtensionEasyBlock.extra_options(extra_vars)
示例12: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options():
"""Easyconfig parameters specific to Perl modules."""
extra_vars = [("runtest", ["test", "Run unit tests.", CUSTOM])] # overrides default
return ExtensionEasyBlock.extra_options(extra_vars)
示例13: extra_options
# 需要导入模块: from easybuild.framework.extensioneasyblock import ExtensionEasyBlock [as 别名]
# 或者: from easybuild.framework.extensioneasyblock.ExtensionEasyBlock import extra_options [as 别名]
def extra_options():
"""Custom easyconfig parameters for toy extensions."""
extra_vars = {
'toy_ext_param': ['', "Toy extension parameter", CUSTOM],
}
return ExtensionEasyBlock.extra_options(extra_vars=extra_vars)