def test_experiment_data(tmpdir, bioc_fetch):
    bioconductor_skeleton.write_recipe('affydata', str(tmpdir), config, recursive=False, packages=bioc_fetch)
    meta = utils.load_first_metadata(str(tmpdir.join('bioconductor-affydata'))).meta
    assert any(dep.startswith('curl ') for dep in meta['requirements']['run'])
    assert len(meta['source']['url']) == 3
    assert not tmpdir.join('bioconductor-affydata', 'build.sh').exists()
    assert tmpdir.join('bioconductor-affydata', 'post-link.sh').exists()
    assert tmpdir.join('bioconductor-affydata', 'pre-unlink.sh').exists()
def test_nonexistent_pkg(tmpdir, bioc_fetch):

    # no such package exists in the current bioconductor
    with pytest.raises(bioconductor_skeleton.PackageNotFoundError):
        bioconductor_skeleton.write_recipe(
            'nonexistent', str(tmpdir), config, recursive=True, packages=bioc_fetch)

    # package exists, but not this version
    with pytest.raises(bioconductor_skeleton.PackageNotFoundError):
        bioconductor_skeleton.write_recipe(
            'DESeq', str(tmpdir), config, recursive=True, pkg_version='5000', packages=bioc_fetch)
def test_bioc_write_recipe_skip_in_condaforge(tmpdir, bioc_fetch):
    bioconductor_skeleton.write_recipe(
        'edgeR', recipe_dir=str(tmpdir), config=config, recursive=True,
        packages=bioc_fetch,
        skip_if_in_channels=['conda-forge'])

    for pkg in [
        'bioconductor-edger', 'bioconductor-limma',
    ]:
        assert tmpdir.join(pkg).exists()

    for pkg in ['r-cpp', 'r-lattice', 'r-locfit']:
        assert not tmpdir.join(pkg).exists()
def test_bioc_write_recipe_no_skipping(tmpdir, bioc_fetch):
    bioconductor_skeleton.write_recipe(
        'edgeR', recipe_dir=str(tmpdir), config=config, recursive=True,
        packages=bioc_fetch,
        skip_if_in_channels=None)

    for pkg in [
        'bioconductor-edger', 'bioconductor-limma', 'r-rcpp'
        # sometime locfit and lattice don't build correctly, but we should
        # eventually ensure they are here as well.
        # 'r-locfit',
        # 'r-lattice',
    ]:
        assert tmpdir.join(pkg).exists()
def test_meta_contents(tmpdir, bioc_fetch):
    config = {
        'channels': ['conda-forge', 'bioconda', 'defaults']
    }
    bioconductor_skeleton.write_recipe(
        'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False, packages=bioc_fetch)

    edger_meta = utils.load_first_metadata(str(tmpdir.join('bioconductor-edger'))).meta
    assert 'r-rcpp' in edger_meta['requirements']['run']

    # The rendered meta has {{ compiler('c') }} filled in, so we need to check
    # for one of those filled-in values.
    names = [i.split()[0] for i in edger_meta['requirements']['build']]
    assert 'libstdcxx-ng' in names or 'clang_osx-64' in names

    # bioconductor, bioarchive, and cargoport
    assert len(edger_meta['source']['url']) == 3
Exemplo n.º 6
0
def test_meta_contents(tmpdir, bioc_fetch):
    config = {'channels': ['conda-forge', 'bioconda', 'defaults']}
    bioconductor_skeleton.write_recipe('edgeR',
                                       recipe_dir=str(tmpdir),
                                       config=config,
                                       recursive=False,
                                       packages=bioc_fetch)

    edger_meta = utils.load_first_metadata(
        str(tmpdir.join('bioconductor-edger'))).meta
    assert 'r-rcpp' in edger_meta['requirements']['run']

    # The rendered meta has {{ compiler('c') }} filled in, so we need to check
    # for one of those filled-in values.
    names = [i.split()[0] for i in edger_meta['requirements']['build']]
    assert 'libstdcxx-ng' in names or 'clang_osx-64' in names

    # bioconductor, bioarchive, and cargoport
    assert len(edger_meta['source']['url']) == 3
def test_overwrite(tmpdir, bioc_fetch):
    bioconductor_skeleton.write_recipe(
        'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False, packages=bioc_fetch)

    # Same thing with force=False returns ValueError
    with pytest.raises(ValueError):
        bioconductor_skeleton.write_recipe(
            'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False, packages=bioc_fetch)

    # But same thing with force=True is OK
    bioconductor_skeleton.write_recipe(
        'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False, force=True, packages=bioc_fetch)
def test_overwrite(tmpdir, bioc_fetch):
    bioconductor_skeleton.write_recipe(
        'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False, packages=bioc_fetch)

    # Same thing with force=False returns ValueError
    with pytest.raises(ValueError):
        bioconductor_skeleton.write_recipe(
            'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False, packages=bioc_fetch)

    # But same thing with force=True is OK
    bioconductor_skeleton.write_recipe(
        'edgeR', recipe_dir=str(tmpdir), config=config, recursive=False, force=True, packages=bioc_fetch)
Exemplo n.º 9
0
recipe_folder = args[0]
config = args[1]
package_list = args[2]

assert os.path.exists(recipe_folder), "Recipe folder exists"
assert os.path.exists(config), "Config file exists"
assert os.path.exists(package_list), "Package list file exists"

handle = open(package_list, "r")

for line in handle:
    pkg = line.strip()
    metafile = recipe_folder + "/" + pkg + "/meta.yaml"
    assert os.path.exists(metafile), "meta.yaml exists for %s" % (pkg)
    metadata = MetaData(metafile)
    # Get the package name (capitalized correctly), version, and Bioconductor
    # release from the meta.yaml file. The purpose of this script is to fix
    # existing recipes, not to update the package to the latest version.
    name, version = metadata.get_value("source/fn").rstrip(".tar.gz").split(
        "_")
    bioc = metadata.get_value("source/url")[0].split("/")[4]
    sys.stderr.write("Writing recipe for %s %s (%s)\n" % (name, version, bioc))
    write_recipe(package=name,
                 recipe_dir=recipe_folder,
                 config=config,
                 force=True,
                 bioc_version=bioc,
                 pkg_version=version)

handle.close()