def pip_install(lib_name, options): virtual_env = os.getenv('VIRTUAL_ENV') requirement = pip_requirement(lib_name, options) req_file = os.path.join(virtual_env, 'install-requirements.txt') write_requirement(requirement, req_file) extra_repos = ['--extra-index-url=' + repo_url for repo_url in extra_pypi_index_servers()] run('pip', 'install', '-E', virtual_env, '-r', req_file, *extra_repos)
def init(): if os.path.exists(spec_path): log('init', "'%s' already exists. Skipping this step." % spec_path) else: cp(os.path.join(home_dir(), 'specs', 'default.py'), spec_path) add_checkpoint(revert_init) # TODO: ensure env_name is unique if os.path.exists(env_path()): log('init', "virtualenv already exists at '%s'. Skipping this step." % env_path()) else: run('virtualenv', '--no-site-packages', env_path())
def post_install(lib_name, options): if 'post_install' in options: # TODO: some working directory magic for cmd in options['post_install']: run(*cmd)
def custom_install(lib_name, options): install_cmd = options['install_with'] run(install_cmd, lib_name)