def single_upload(): """ Creates a randomly-named recipe and uploads it using a label so that it doesn't affect the main bioconda channel. Tests that depend on this fixture get a tuple of name, pakage, recipe dir. Cleans up when it's done. """ name = 'upload-test-' + str(uuid.uuid4()).split('-')[0] r = Recipes(''' {0}: meta.yaml: | package: name: {0} version: "0.1" '''.format(name), from_string=True) r.write_recipes() env_matrix = list(utils.EnvMatrix(tmp_env_matrix()))[0] build.build( recipe=r.recipe_dirs[name], recipe_folder='.', docker_builder=None, mulled_test=False, env=env_matrix, ) pkg = utils.built_package_path(r.recipe_dirs[name]) with utils.temp_env( dict(TRAVIS_BRANCH='master', TRAVIS_PULL_REQUEST='false')): upload.anaconda_upload(pkg, label=TEST_LABEL) yield (name, pkg, r.recipe_dirs[name]) p = sp.run([ 'anaconda', '-t', os.environ.get('ANACONDA_TOKEN'), 'remove', 'bioconda/{0}'.format(name), '--force' ], stdout=sp.PIPE, stderr=sp.STDOUT, check=True, universal_newlines=True)
def single_upload(): """ Creates a randomly-named recipe and uploads it using a label so that it doesn't affect the main bioconda channel. Tests that depend on this fixture get a tuple of name, pakage, recipe dir. Cleans up when it's done. """ name = 'upload-test-' + str(uuid.uuid4()).split('-')[0] r = Recipes(''' {0}: meta.yaml: | package: name: {0} version: "0.1" '''.format(name), from_string=True) r.write_recipes() r.pkgs = {} r.pkgs[name] = utils.built_package_paths(r.recipe_dirs[name]) build.build(recipe=r.recipe_dirs[name], recipe_folder='.', pkg_paths=r.pkgs[name], docker_builder=None, mulled_test=False) pkg = r.pkgs[name][0] upload.anaconda_upload(pkg, label=TEST_LABEL) yield (name, pkg, r.recipe_dirs[name]) sp.run([ 'anaconda', '-t', os.environ.get('ANACONDA_TOKEN'), 'remove', 'bioconda/{0}'.format(name), '--force' ], stdout=sp.PIPE, stderr=sp.STDOUT, check=True, universal_newlines=True)
def single_upload(): """ Creates a randomly-named recipe and uploads it using a label so that it doesn't affect the main bioconda channel. Tests that depend on this fixture get a tuple of name, pakage, recipe dir. Cleans up when it's done. """ name = 'upload-test-' + str(uuid.uuid4()).split('-')[0] r = Recipes( ''' {0}: meta.yaml: | package: name: {0} version: "0.1" '''.format(name), from_string=True) r.write_recipes() r.pkgs = {} r.pkgs[name] = utils.built_package_paths(r.recipe_dirs[name]) build.build( recipe=r.recipe_dirs[name], recipe_folder='.', pkg_paths=r.pkgs[name], docker_builder=None, mulled_test=False ) pkg = r.pkgs[name][0] upload.anaconda_upload(pkg, label=TEST_LABEL) yield (name, pkg, r.recipe_dirs[name]) sp.run( ['anaconda', '-t', os.environ.get('ANACONDA_TOKEN'), 'remove', 'bioconda/{0}'.format(name), '--force'], stdout=sp.PIPE, stderr=sp.STDOUT, check=True, universal_newlines=True)