def conda(prefix='~/miniconda', use_sudo=False): """ Require conda to be installed. If conda is not installed the latest version of miniconda will be installed. :param prefix: prefix for the miniconda installation :param use_sudo: use sudo for this operation """ if not is_conda_installed(): install_miniconda(prefix=prefix, use_sudo=use_sudo)
def test_conda_install_and_check(): assert conda.is_conda_installed() == False conda.install_miniconda(keep_installer=True) assert conda.is_conda_installed() run('rm -rf miniconda') assert conda.is_conda_installed() == False conda.install_miniconda(prefix='~/myminiconda', keep_installer=True) assert conda.get_sysprefix() == utils.abspath('myminiconda') assert conda.is_conda_installed() run('rm -rf myminiconda') assert conda.is_conda_installed() == False conda.install_miniconda(keep_installer=True)