How to use the kedro.cli.utils.forward_command function in kedro

To help you get started, weā€™ve selected a few kedro examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github quantumblacklabs / kedro / tests / cli / test_cli.py View on Github external
@forward_command(stub_cli, name="forwarded_command")
def forwarded_command(args):
    print("fred", args)
github quantumblacklabs / kedro / tests / cli / test_cli.py View on Github external
@forward_command(stub_cli)
def unnamed(args):
    print("fred", args)
github quantumblacklabs / kedro / kedro / template / {{ cookiecutter.repo_name }} / kedro_cli.py View on Github external
@forward_command(cli, forward_help=True)
def test(args):
    """Run the test suite."""
    try:
        import pytest  # pylint: disable=unused-import
    except ImportError:
        raise KedroCliError(NO_DEPENDENCY_MESSAGE.format("pytest"))
    else:
        python_call("pytest", args)
github Minyus / causallift / kedro_cli.py View on Github external
@forward_command(jupyter, "lab", forward_help=True)
@click.option("--ip", type=str, default="127.0.0.1")
@click.option("--all-kernels", is_flag=True, default=False)
def jupyter_lab(ip, all_kernels, args):
    """Open Jupyter Lab with project specific variables loaded."""
    if "-h" not in args and "--help" not in args:
        ipython_message(all_kernels)

    call(
        _build_jupyter_command("jupyter-lab", ip=ip, all_kernels=all_kernels, args=args)
    )
github Minyus / causallift / kedro_cli.py View on Github external
@forward_command(cli, forward_help=True)
def ipython(args):
    """Open IPython with project specific variables loaded."""
    if "-h" not in args and "--help" not in args:
        ipython_message()
    call(["ipython"] + list(args))
github quantumblacklabs / kedro-docker / kedro_docker / plugin.py View on Github external
@forward_command(docker_jupyter, "lab")
@_make_image_option(callback=_image_callback)
@_make_port_option()
@_make_docker_args_option()
def docker_jupyter_lab(docker_args, port, image, args):
    """Run jupyter lab in the Docker container.
    Any extra arguments unspecified in this help are passed to
    `kedro jupyter lab` command inside the container as is."""

    container_name = make_container_name(image, "jupyter-lab")
    _docker_run_args = compose_docker_run_args(
        required_args=[("-p", "{}:8888".format(port))],
        optional_args=[("--rm", None), ("-it", None), ("--name", container_name)],
        user_args=docker_args,
        **_mount_info()
    )
github quantumblacklabs / kedro-examples / kedro-tutorial / kedro_cli.py View on Github external
@forward_command(jupyter, "notebook", forward_help=True)
@click.option("--ip", type=str, default="127.0.0.1", help=JUPYTER_IP_HELP)
@click.option(
    "--all-kernels", is_flag=True, default=False, help=JUPYTER_ALL_KERNELS_HELP
)
@click.option("--idle-timeout", type=int, default=30, help=JUPYTER_IDLE_TIMEOUT_HELP)
@click.option(
    "--env",
    "-e",
    type=str,
    default=None,
    multiple=False,
    help=ENV_ARG_HELP,
)
def jupyter_notebook(ip, all_kernels, env, idle_timeout, args):
    """Open Jupyter Notebook with project specific variables loaded."""
    if "-h" not in args and "--help" not in args:
github Minyus / causallift / kedro_cli.py View on Github external
@forward_command(jupyter, "notebook", forward_help=True)
@click.option("--ip", type=str, default="127.0.0.1")
@click.option("--all-kernels", is_flag=True, default=False)
def jupyter_notebook(ip, all_kernels, args):
    """Open Jupyter Notebook with project specific variables loaded."""
    if "-h" not in args and "--help" not in args:
        ipython_message(all_kernels)

    call(
        _build_jupyter_command(
            "jupyter-notebook", ip=ip, all_kernels=all_kernels, args=args
        )
github tipresias / tipresias / data_science / kedro_cli.py View on Github external
@forward_command(jupyter, "notebook", forward_help=True)
@click.option("--ip", type=str, default="127.0.0.1")
def jupyter_notebook(ip, args):
    """Open Jupyter Notebook with project specific variables loaded."""
    if "-h" not in args and "--help" not in args:
        ipython_message()
    call(["jupyter-notebook", "--ip=" + ip] + list(args))
github tipresias / tipresias / data_science / kedro_cli.py View on Github external
@forward_command(jupyter, "lab", forward_help=True)
@click.option("--ip", type=str, default="127.0.0.1")
def jupyter_lab(ip, args):
    """Open Jupyter Lab with project specific variables loaded."""
    if "-h" not in args and "--help" not in args:
        ipython_message()
    call(["jupyter-lab", "--ip=" + ip] + list(args))