コード例 #1
0
ファイル: play.py プロジェクト: acartagena/yellfabric
def sync_deps():
    """
    Download project dependencies and sync modules/lib dirs.
    """

    require(
        "project_path",
        "http_proxy",
        "https_proxy",
        "sudo_user",
    )
    with context_managers.proxy(env.http_proxy, env.https_proxy):
        utils.play_run(env.project_path, "dependencies --sync", user=env.sudo_user)
コード例 #2
0
def sync_deps():
    """
    Download project dependencies and sync modules/lib dirs.
    """

    require(
        "project_path",
        "http_proxy",
        "https_proxy",
        "sudo_user",
    )
    with context_managers.proxy(env.http_proxy, env.https_proxy):
        utils.play_run(env.project_path, "dependencies --sync", user=env.sudo_user)
コード例 #3
0
ファイル: play.py プロジェクト: YellLabs/yellfabric
def sync_deps():
    """
    Download project dependencies and sync modules/lib dirs.

    Abort if there are any missing dependencies.
    """

    require(
        "project_path",
        "http_proxy",
        "https_proxy",
        "sudo_user",
    )
    with context_managers.proxy(env.http_proxy, env.https_proxy):
        out = utils.play_run(env.project_path, "dependencies --sync", user=env.sudo_user)

    if "WARNING" in out:
        abort("Missing dependencies")
コード例 #4
0
ファイル: python.py プロジェクト: scandian/yellfabric
def pip_requirements():
    """
    Install project requirements using PIP into a Python virtual environment.
    """

    require(
        "virtualenv_path",
        "requirements_path",
        "http_proxy",
        "https_proxy",
        "sudo_user",
    )
    cmd = "pip install --quiet --requirement %s" % env.requirements_path

    # append packages url if specified
    if env.get("packages_url") is not None:
        cmd += " -f %s" % env.get("packages_url")

    with context_managers.proxy(env.http_proxy, env.https_proxy):
        with context_managers.virtualenv(env.virtualenv_path):
            sudo(cmd, user=env.sudo_user)
コード例 #5
0
ファイル: python.py プロジェクト: andrewjdarnell/yellfabric
def pip_requirements():
    """
    Install project requirements using PIP into a Python virtual environment.
    """

    require(
        "virtualenv_path",
        "requirements_path",
        "http_proxy",
        "https_proxy",
        "sudo_user",
    )
    cmd = "pip install --quiet --requirement %s" % env.requirements_path

    # append packages url if specified
    if env.get("packages_url") is not None:
        cmd += " -f %s" % env.get("packages_url")

    with context_managers.proxy(env.http_proxy, env.https_proxy):
        with context_managers.virtualenv(env.virtualenv_path):
            sudo(cmd, user=env.sudo_user)
コード例 #6
0
ファイル: python.py プロジェクト: andrewjdarnell/yellfabric
def create_virtualenv():
    """
    Create a Python virtual environment.
    """

    require(
        "virtualenv_path",
        "python_bin",
        "http_proxy",
        "https_proxy",
        "sudo_user",
    )
    # Added system-site-packages as environment
    # uses global packages like MySQLdb
    cmd = "virtualenv --python %s %s --system-site-packages" % (env.python_bin, env.virtualenv_path)

    with context_managers.proxy(env.http_proxy, env.https_proxy):
        # Needs to cd into a directory that the sudo user can temporarily write
        # to.
        with cd("/tmp"):
            sudo(cmd, user=env.sudo_user)
コード例 #7
0
ファイル: python.py プロジェクト: scandian/yellfabric
def create_virtualenv():
    """
    Create a Python virtual environment.
    """

    require(
        "virtualenv_path",
        "python_bin",
        "http_proxy",
        "https_proxy",
        "sudo_user",
    )
    # Added system-site-packages as environment
    # uses global packages like MySQLdb
    cmd = "virtualenv --python %s %s --system-site-packages" % (
        env.python_bin, env.virtualenv_path)

    with context_managers.proxy(env.http_proxy, env.https_proxy):
        # Needs to cd into a directory that the sudo user can temporarily write
        # to.
        with cd("/tmp"):
            sudo(cmd, user=env.sudo_user)