def _fetch_from_pypi(pkg):
    tmpdir = tempfile.mkdtemp(prefix='shub-deploy-egg-from-pypi')

    log('Fetching %s from pypi' % pkg)
    pip_cmd = "pip install -d %s %s --no-deps --no-use-wheel" % (tmpdir, pkg)
    log(run(pip_cmd))
    log('Package fetched successfully')
    os.chdir(tmpdir)
Exemple #2
0
def _download_egg_files(eggs_dir, requirements_file):
    editable_src_dir = tempfile.mkdtemp(prefix='pipsrc')

    log('Downloading eggs...')
    try:
        pip_cmd = ("pip install -d {eggs_dir} -r {requirements_file}"
                   " --src {editable_src_dir} --no-deps --no-use-wheel")
        log(run(pip_cmd.format(eggs_dir=eggs_dir,
                               editable_src_dir=editable_src_dir,
                               requirements_file=requirements_file)))
    finally:
        shutil.rmtree(editable_src_dir, ignore_errors=True)