Example #1
0
def run_hook(
    hook: Hook,
    file_args: Sequence[str],
    color: bool,
) -> tuple[int, bytes]:  # pragma: win32 no cover
    cmd = docker_cmd() + hook.cmd
    return helpers.run_xargs(hook, cmd, file_args, color=color)
Example #2
0
def run_hook(
        hook: Hook,
        file_args: Sequence[str],
        color: bool,
) -> Tuple[int, bytes]:
    cmd = (hook.prefix.path(hook.cmd[0]), *hook.cmd[1:])
    return helpers.run_xargs(hook, cmd, file_args, color=color)
Example #3
0
def run_hook(hook: Hook, file_args: Sequence[str], color: bool,) -> Tuple[int, bytes]:
    # TODO: Some rare commands need to be run using `conda run` but mostly we
    #       can run them withot which is much quicker and produces a better
    #       output.
    # cmd = ('conda', 'run', '-p', env_dir) + hook.cmd
    with in_env(hook.prefix, hook.language_version):
        return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #4
0
def run_hook(
    hook: Hook,
    file_args: Sequence[str],
    color: bool,
) -> tuple[int, bytes]:  # pragma: win32 no cover
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #5
0
def run_hook(
    hook: Hook,
    file_args: Sequence[str],
    color: bool,
) -> Tuple[int, bytes]:
    with in_env(hook.prefix, hook.language_version):
        return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #6
0
def run_hook(
    hook: Hook,
    file_args: Sequence[str],
    color: bool,
) -> Tuple[int, bytes]:  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + hook.cmd
    return helpers.run_xargs(hook, cmd, file_args, color=color)
Example #7
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_exe, cmd_rest = hook_cmd[0], hook_cmd[1:]

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = docker_cmd() + entry_tag + cmd_rest
    return helpers.run_xargs(hook, cmd, file_args)
Example #8
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    hook_cmd = helpers.to_cmd(hook)
    entry_exe, cmd_rest = hook_cmd[0], hook_cmd[1:]

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = docker_cmd() + entry_tag + cmd_rest
    return helpers.run_xargs(hook, cmd, file_args)
Example #9
0
def run_hook(
    hook: Hook,
    file_args: Sequence[str],
    color: bool,
) -> Tuple[int, bytes]:  # pragma: win32 no cover
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    entry_exe, *cmd_rest = hook.cmd

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = (*docker_cmd(), *entry_tag, *cmd_rest)
    return helpers.run_xargs(hook, cmd, file_args, color=color)
Example #10
0
def run_hook(
    hook: 'Hook',
    file_args: Sequence[str],
    color: bool,
) -> Tuple[int, bytes]:  # pragma: windows no cover
    assert_docker_available()
    # Rebuild the docker image in case it has gone missing, as many people do
    # automated cleanup of docker images.
    build_docker_image(hook.prefix, pull=False)

    hook_cmd = hook.cmd
    entry_exe, cmd_rest = hook.cmd[0], hook_cmd[1:]

    entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
    cmd = docker_cmd() + entry_tag + cmd_rest
    return helpers.run_xargs(hook, cmd, file_args, color=color)
Example #11
0
def run_hook(hook, file_args, color):
    cmd = hook.cmd
    cmd = (hook.prefix.path(cmd[0]), ) + cmd[1:]
    return helpers.run_xargs(hook, cmd, file_args, color=color)
Example #12
0
def run_hook(prefix, hook, file_args):
    return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Example #13
0
def run_hook(
        hook: Hook,
        file_args: Sequence[str],
        color: bool,
) -> Tuple[int, bytes]:
    return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #14
0
def run_hook(hook, file_args, color):
    return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #15
0
def run_hook(hook, file_args, color):
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #16
0
def run_hook(hook, file_args):
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Example #17
0
def run_hook(hook, file_args):
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Example #18
0
def run_hook(hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (hook.prefix.path(cmd[0]),) + cmd[1:]
    return helpers.run_xargs(hook, cmd, file_args)
Example #19
0
def run_hook(hook, file_args, color):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + hook.cmd
    return helpers.run_xargs(hook, cmd, file_args, color=color)
Example #20
0
def run_hook(prefix, hook, file_args):
    with in_env(prefix, hook['language_version']):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Example #21
0
def run_hook(hook, file_args, color):  # pragma: windows no cover
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #22
0
def run_hook(hook, file_args):
    cmd = helpers.to_cmd(hook)
    cmd = (hook.prefix.path(cmd[0]), ) + cmd[1:]
    return helpers.run_xargs(hook, cmd, file_args)
Example #23
0
def run_hook(hook, file_args):  # pragma: windows no cover
    with in_env(hook.prefix):
        return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Example #24
0
def run_hook(hook, file_args):
    return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)
Example #25
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return helpers.run_xargs(hook, cmd, file_args)
Example #26
0
 def run_hook(hook, file_args, color):
     with in_env(hook.prefix, hook.language_version):
         return helpers.run_xargs(hook, hook.cmd, file_args, color=color)
Example #27
0
def run_hook(hook, file_args):  # pragma: windows no cover
    assert_docker_available()
    cmd = docker_cmd() + helpers.to_cmd(hook)
    return helpers.run_xargs(hook, cmd, file_args)
Example #28
0
 def run_hook(hook, file_args):
     with in_env(hook.prefix, hook.language_version):
         return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)