Beispiel #1
0
def uninstall(env, lib):
    lib_ = lib.replace('==', '=')  # obviously conda syntax is different
    success = (safe_shell_out(["conda", "remove", lib_, "-p", env.name,
                               "--yes", "--quiet"], cwd=env.toxdir) or
               safe_shell_out([env.pip, "uninstall", lib,
                               "--yes", "--quiet"], cwd=env.toxdir))
    return success
Beispiel #2
0
def install(env, lib):
    lib_ = lib.replace("==", "=")  # obviously conda syntax is different
    success = safe_shell_out(
        ["conda", "install", lib_, "-p", env.name, "--yes", "--quiet"], cwd=env.toxdir
    ) or safe_shell_out([env.pip, "install", "--quiet", lib], cwd=env.toxdir)

    if success:
        with open(env.envctoxfile, "a") as f:
            f.write(" " + lib)
    else:
        cprint("    Unable to install %s." % lib, "err")
    return success
Beispiel #3
0
def install(env, lib):
    lib_ = lib.replace('==', '=')  # obviously conda syntax is different
    success = (safe_shell_out(["conda", "install", lib_, "-p", env.name,
                               "--yes", "--quiet"], cwd=env.toxdir) or
               safe_shell_out([env.pip, "install",
                               "--quiet", lib], cwd=env.toxdir))

    if success:
        with open(env.envctoxfile, 'a') as f:
            f.write(" " + lib)
    else:
        cprint("    Unable to install %s." % lib, 'err')
    return success
Beispiel #4
0
def make_dist(toxinidir, toxdir, package):
    """zip up the package into the toxdir."""
    dist = os.path.join(toxdir, "dist")
    # Suppress warnings.
    success = safe_shell_out(
        ["python", "setup.py", "sdist", "--quiet", "--formats=zip", "--dist-dir", dist], cwd=toxinidir
    )
    if success:
        return os.path.join(dist, package + ".zip")
Beispiel #5
0
def make_dist(toxinidir, toxdir, package):
    """zip up the package into the toxdir."""
    dist = os.path.join(toxdir, "dist")
    # Suppress warnings.
    success = safe_shell_out(["python", "setup.py", "sdist", "--quiet",
                              "--formats=zip", "--dist-dir", dist],
                             cwd=toxinidir)
    if success:
        return os.path.join(dist, package + ".zip")
Beispiel #6
0
def install_dist(env):
    # TODO don't rebuild if not changed?
    # At the moment entire dir is wiped, really we want to update, which would
    # allow us to reuse  previously built files (e.g. pyc) if unchanged...
    # This is usually done in the setup.py into a directory...
    print("installing...")
    return safe_shell_out([env.pip, "install", env.package_zipped,
                           "--no-deps", "--upgrade",
                           # "-t", env.envdistdir,
                           ],
                          cwd=env.toxdir)
Beispiel #7
0
def install_dist(env):
    # TODO don't rebuild if not changed?
    # At the moment entire dir is wiped, really we want to update, which would
    # allow us to reuse  previously built files (e.g. pyc) if unchanged...
    # This is usually done in the setup.py into a directory...
    print("installing...")
    return safe_shell_out(
        [
            env.pip,
            "install",
            env.package_zipped,
            "--no-deps",
            "--upgrade",
            # "-t", env.envdistdir,
        ],
        cwd=env.toxdir,
    )
Beispiel #8
0
def uninstall(env, lib):
    lib_ = lib.replace("==", "=")  # obviously conda syntax is different
    success = safe_shell_out(
        ["conda", "remove", lib_, "-p", env.name, "--yes", "--quiet"], cwd=env.toxdir
    ) or safe_shell_out([env.pip, "uninstall", lib, "--yes", "--quiet"], cwd=env.toxdir)
    return success