当前位置: 首页>>代码示例>>Python>>正文


Python ExtensionEasyBlock.extra_options方法代码示例

本文整理汇总了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
开发者ID:Gregor-Mendel-Institute,项目名称:easybuild-easyblocks,代码行数:9,代码来源:rpackage.py

示例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
开发者ID:migueldiascosta,项目名称:easybuild-easyblocks,代码行数:10,代码来源:rpackage.py

示例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)
开发者ID:QhorinHalfhand,项目名称:easybuild-easyblocks,代码行数:12,代码来源:pythonpackage.py

示例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)
开发者ID:dlagrava,项目名称:easybuild-easyblocks,代码行数:16,代码来源:pythonpackage.py

示例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)
开发者ID:boegel,项目名称:easybuild-easyblocks,代码行数:20,代码来源:pythonpackage.py

示例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)
开发者ID:FredHutch,项目名称:easybuild-easyblocks,代码行数:8,代码来源:perlmodule.py

示例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)
开发者ID:migueldiascosta,项目名称:easybuild-framework,代码行数:75,代码来源:easyblock.py

示例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]})
开发者ID:migueldiascosta,项目名称:easybuild-framework,代码行数:4,代码来源:easyblock.py

示例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)
开发者ID:JensTimmerman,项目名称:easybuild-framework,代码行数:72,代码来源:easyblock.py

示例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])])
开发者ID:JensTimmerman,项目名称:easybuild-framework,代码行数:4,代码来源:easyblock.py

示例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)
开发者ID:lsuhpchelp,项目名称:easybuild_smic,代码行数:8,代码来源:pythonpackage.py

示例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)
开发者ID:Bart-VUB,项目名称:easybuild-easyblocks,代码行数:6,代码来源:perlmodule.py

示例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)
开发者ID:hpcugent,项目名称:easybuild-framework,代码行数:8,代码来源:toy_extension.py


注:本文中的easybuild.framework.extensioneasyblock.ExtensionEasyBlock.extra_options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。