Beispiel #1
0
def _python_library_installer(config):
    """Install python specific libraries using easy_install.
    """
    version_ext = "-%s" % env.python_version_ext if env.python_version_ext else ""
    env.safe_sudo("easy_install%s -U pip" % version_ext)
    for pname in env.flavor.rewrite_config_items("python", config['pypi']):
        env.safe_sudo("{0} install --upgrade {1}".format(_pip_cmd(env), pname))
Beispiel #2
0
def _python_library_installer(config):
    """Install python specific libraries using easy_install.
    """
    version_ext = "-%s" % env.python_version_ext if env.python_version_ext else ""
    env.safe_sudo("easy_install%s -U pip" % version_ext)
    for pname in env.flavor.rewrite_config_items("python", config["pypi"]):
        env.safe_sudo("{0} install --upgrade {1}".format(_pip_cmd(env), pname))
Beispiel #3
0
def _python_library_installer(config):
    """Install python specific libraries using pip, conda and easy_install.
    Handles using isolated anaconda environments.
    """
    if shared._is_anaconda(env):
        conda_bin = shared._conda_cmd(env)
        for pname in env.flavor.rewrite_config_items("python", config.get("conda", [])):
            env.safe_run("{0} install --yes {1}".format(conda_bin, pname))
        cmd = env.safe_run
        with settings(warn_only=True):
            cmd("%s -U distribute" % os.path.join(os.path.dirname(conda_bin), "easy_install"))
    else:
        pip_bin = shared._pip_cmd(env)
        ei_bin = pip_bin.replace("pip", "easy_install")
        env.safe_sudo("%s -U pip" % ei_bin)
        with settings(warn_only=True):
            env.safe_sudo("%s -U distribute" % ei_bin)
        cmd = env.safe_sudo
    for pname in env.flavor.rewrite_config_items("python", config['pypi']):
        cmd("{0} install --upgrade {1}".format(shared._pip_cmd(env), pname))
Beispiel #4
0
def _python_library_installer(config):
    """Install python specific libraries using pip, conda and easy_install.
    Handles using isolated anaconda environments.
    """
    if shared._is_anaconda(env):
        conda_bin = shared._conda_cmd(env)
        for pname in env.flavor.rewrite_config_items("python",
                                                     config.get("conda", [])):
            env.safe_run("{0} install --yes {1}".format(conda_bin, pname))
        cmd = env.safe_run
        with settings(warn_only=True):
            cmd("%s -U distribute" %
                os.path.join(os.path.dirname(conda_bin), "easy_install"))
    else:
        pip_bin = shared._pip_cmd(env)
        ei_bin = pip_bin.replace("pip", "easy_install")
        env.safe_sudo("%s -U pip" % ei_bin)
        with settings(warn_only=True):
            env.safe_sudo("%s -U distribute" % ei_bin)
        cmd = env.safe_sudo
    for pname in env.flavor.rewrite_config_items("python", config['pypi']):
        cmd("{0} install --upgrade {1}".format(shared._pip_cmd(env), pname))
Beispiel #5
0
def _python_library_installer(config):
    """Install python specific libraries using easy_install.
    Handles using isolated anaconda environments.
    """
    if shared._is_anaconda(env):
        for pname in env.flavor.rewrite_config_items("python", config.get("conda", [])):
            env.safe_run("{0} install --yes {1}".format(shared._conda_cmd(env), pname))
        cmd = env.safe_run
    else:
        version_ext = "-%s" % env.python_version_ext if env.python_version_ext else ""
        env.safe_sudo("easy_install%s -U pip" % version_ext)
        cmd = env.safe_sudo
    for pname in env.flavor.rewrite_config_items("python", config['pypi']):
        cmd("{0} install --upgrade {1}".format(shared._pip_cmd(env), pname))
Beispiel #6
0
def _python_library_installer(config):
    """Install python specific libraries using easy_install.
    Handles using isolated anaconda environments.
    """
    if shared._is_anaconda(env):
        for pname in env.flavor.rewrite_config_items("python",
                                                     config.get("conda", [])):
            env.safe_run("{0} install --yes {1}".format(
                shared._conda_cmd(env), pname))
        cmd = env.safe_run
    else:
        version_ext = "-%s" % env.python_version_ext if env.python_version_ext else ""
        env.safe_sudo("easy_install%s -U pip" % version_ext)
        cmd = env.safe_sudo
    for pname in env.flavor.rewrite_config_items("python", config['pypi']):
        cmd("{0} install --upgrade {1}".format(shared._pip_cmd(env), pname))
    def post_install(self):
        # Manually install logrotate, postgresql-9.3, rabbitmq-server.
        # postgresql-9.3 and rabbitmq-server require incompatible versions of
        # logrotate by default, so we force install the working version.
        env.safe_sudo("apt-get -y --force-yes install logrotate=3.7.8-6ubuntu5")
        env.safe_sudo("apt-get -y --force-yes install postgresql-9.3")
        env.safe_sudo("apt-get -y --force-yes install libpq-dev")
        env.safe_sudo("apt-get -y --force-yes install pgdg-keyring")
        env.safe_sudo("apt-get -y --force-yes install rabbitmq-server")

        # Now install psycogpg2, which requires postgresql-9.3 and related
        # to have been installed first.
        env.safe_sudo("{0} install --upgrade {1}".format(shared._pip_cmd(env), 'psycopg2'))

        # Finally, install Millstone.
        install_millstone(self.env)
Beispiel #8
0
def _python_library_installer(config):
    """Install python specific libraries using easy_install.
    Handles using isolated anaconda environments.
    """
    with quiet():
        is_anaconda = env.safe_run_output("conda -h").startswith("usage: conda")
    if is_anaconda:
        for pname in env.flavor.rewrite_config_items("python", config.get("conda", [])):
            env.safe_run("conda install --yes {0}".format(pname))
        cmd = env.safe_run
    else:
        version_ext = "-%s" % env.python_version_ext if env.python_version_ext else ""
        env.safe_sudo("easy_install%s -U pip" % version_ext)
        cmd = env.safe_sudo
    for pname in env.flavor.rewrite_config_items("python", config['pypi']):
        cmd("{0} install --upgrade {1}".format(_pip_cmd(env), pname))
Beispiel #9
0
    def post_install(self):
        # Manually install logrotate, postgresql-9.3, rabbitmq-server.
        # postgresql-9.3 and rabbitmq-server require incompatible versions of
        # logrotate by default, so we force install the working version.
        env.safe_sudo(
            "apt-get -y --force-yes install logrotate=3.7.8-6ubuntu5")
        env.safe_sudo("apt-get -y --force-yes install postgresql-9.3")
        env.safe_sudo("apt-get -y --force-yes install libpq-dev")
        env.safe_sudo("apt-get -y --force-yes install pgdg-keyring")
        env.safe_sudo("apt-get -y --force-yes install rabbitmq-server")

        # Now install psycogpg2, which requires postgresql-9.3 and related
        # to have been installed first.
        env.safe_sudo("{0} install --upgrade {1}".format(
            shared._pip_cmd(env), 'psycopg2'))

        # Finally, install Millstone.
        install_millstone(self.env)