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


Python Stage.expand_archive方法代码示例

本文整理汇总了Python中spack.stage.Stage.expand_archive方法的典型用法代码示例。如果您正苦于以下问题:Python Stage.expand_archive方法的具体用法?Python Stage.expand_archive怎么用?Python Stage.expand_archive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在spack.stage.Stage的用法示例。


在下文中一共展示了Stage.expand_archive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_restage

# 需要导入模块: from spack.stage import Stage [as 别名]
# 或者: from spack.stage.Stage import expand_archive [as 别名]
    def test_restage(self):
        stage = Stage(archive_url, name=stage_name)

        stage.fetch()
        stage.expand_archive()
        stage.chdir_to_archive()
        self.check_expand_archive(stage, stage_name)
        self.check_chdir_to_archive(stage, stage_name)

        # Try to make a file in the old archive dir
        with closing(open('foobar', 'w')) as file:
            file.write("this file is to be destroyed.")

        self.assertTrue('foobar' in os.listdir(stage.expanded_archive_path))

        # Make sure the file is not there after restage.
        stage.restage()
        self.check_chdir(stage, stage_name)
        self.check_fetch(stage, stage_name)

        stage.chdir_to_archive()
        self.check_chdir_to_archive(stage, stage_name)
        self.assertFalse('foobar' in os.listdir(stage.expanded_archive_path))

        stage.destroy()
        self.check_destroy(stage, stage_name)
开发者ID:scrobey,项目名称:spack,代码行数:28,代码来源:stage.py

示例2: test_expand_archive

# 需要导入模块: from spack.stage import Stage [as 别名]
# 或者: from spack.stage.Stage import expand_archive [as 别名]
    def test_expand_archive(self):
        stage = Stage(archive_url, name=stage_name)

        stage.fetch()
        self.check_setup(stage, stage_name)
        self.check_fetch(stage, stage_name)

        stage.expand_archive()
        self.check_expand_archive(stage, stage_name)

        stage.destroy()
        self.check_destroy(stage, stage_name)
开发者ID:scrobey,项目名称:spack,代码行数:14,代码来源:stage.py

示例3: install

# 需要导入模块: from spack.stage import Stage [as 别名]
# 或者: from spack.stage.Stage import expand_archive [as 别名]
    def install(self, spec, prefix):

        build_dir = join_path(self.stage.source_path, "builddir")
        os.mkdir(build_dir)

        stage1 = Stage("https://github.com/ncbi/ngs/archive/1.1.3.tar.gz") # Download tarball. fetch() doesn't work with git url?
        stage1.fetch()
        stage1.expand_archive()

        with working_dir(stage1.source_path):
            ngs_build = join_path(stage1.source_path,"builddir")
            os.mkdir(ngs_build)
            configure("--build-prefix="+ ngs_build, "--prefix=" + prefix)
            make("ngs-sdk")
            make("ngs-python")
            make("ngs-java")
            configure("--build-prefix=" + ngs_build, "--with-ngs-sdk=" + prefix, "--prefix=" + prefix)
            make("ngs-bam")
            make("install")


        stage2 = Stage("https://github.com/ncbi/ncbi-vdb/archive/2.5.2.tar.gz")
        stage2.fetch()
        stage2.expand_archive()

        with working_dir(stage2.source_path):
            vdb_build = join_path(stage2.source_path,"builddir")
            os.mkdir(vdb_build)
            configure("--build-prefix=" + vdb_build,"--with-ngs-sdk-prefix=" + prefix, "--with-ngs-java-prefix=" + prefix, "--prefix=" + prefix)
            make()
            make("install")

        # sra-tools build block
        with working_dir(self.stage.source_path):
            configure("--build-prefix=" + build_dir,
                    "--with-ngs-sdk-prefix=" + prefix, "--with-ncbi-vdb-build=" + vdb_build, "--with-ncbi-vdb-sources=" + stage2.source_path,
                    "--prefix=" + prefix)
            make()
            make("install")
开发者ID:mamelara,项目名称:jgi-spack,代码行数:41,代码来源:sratoolkit.py


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