Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flytekit/clis/sdk_in_container/backfill.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing
from datetime import datetime, timedelta

import click
import rich_click as click

from flytekit.clis.sdk_in_container.helpers import get_and_save_remote_with_click_context
from flytekit.clis.sdk_in_container.run import DateTimeType, DurationParamType
Expand All @@ -10,8 +10,8 @@
The backfill command generates and registers a new workflow based on the input launchplan to run an
automated backfill. The workflow can be managed using the Flyte UI and can be canceled, relaunched, and recovered.

- ``launchplan`` refers to the name of the Launchplan
- ``launchplan_version`` is optional and should be a valid version for a Launchplan version.
- ``launchplan`` refers to the name of the Launchplan
- ``launchplan_version`` is optional and should be a valid version for a Launchplan version.
"""


Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pathlib
import typing

import click
import rich_click as click
from typing_extensions import OrderedDict

from flytekit.clis.sdk_in_container.constants import CTX_MODULE, CTX_PROJECT_ROOT
Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import click as _click
import rich_click as _click

CTX_PROJECT = "project"
CTX_DOMAIN = "domain"
Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import replace
from typing import Optional

import click
import rich_click as click

from flytekit.clis.sdk_in_container.constants import CTX_CONFIG_FILE
from flytekit.configuration import Config, ImageConfig, get_config_file
Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/init.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import click
import rich_click as click
from cookiecutter.main import cookiecutter


Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/launchplan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import click
import rich_click as click

from flytekit.clis.sdk_in_container.helpers import get_and_save_remote_with_click_context
from flytekit.models.launch_plan import LaunchPlanState
Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/local_cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import click
import rich_click as click

from flytekit.core.local_cache import LocalTaskCache

Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import click
import rich_click as click

from flytekit.clis.helpers import display_help_with_error
from flytekit.clis.sdk_in_container import constants
Expand Down
4 changes: 2 additions & 2 deletions flytekit/clis/sdk_in_container/pyflyte.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing

import click
import grpc
import rich_click as click
from google.protobuf.json_format import MessageToJson

from flytekit import configuration
Expand Down Expand Up @@ -74,7 +74,7 @@ def pretty_print_exception(e: Exception):
click.secho(f"Failed with Unknown Exception {type(e)} Reason: {e}", fg="red") # noqa


class ErrorHandlingCommand(click.Group):
class ErrorHandlingCommand(click.RichGroup):
def invoke(self, ctx: click.Context) -> typing.Any:
try:
return super().invoke(ctx)
Expand Down
2 changes: 1 addition & 1 deletion flytekit/clis/sdk_in_container/register.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import typing

import click
import rich_click as click

from flytekit.clis.helpers import display_help_with_error
from flytekit.clis.sdk_in_container import constants
Expand Down
6 changes: 3 additions & 3 deletions flytekit/clis/sdk_in_container/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from dataclasses import dataclass
from typing import cast

import click
import rich_click as click
from dataclasses_json import DataClassJsonMixin
from pytimeparse import parse
from typing_extensions import get_args
Expand Down Expand Up @@ -610,7 +610,7 @@ def _run(*args, **kwargs):
return _run


class WorkflowCommand(click.MultiCommand):
class WorkflowCommand(click.RichGroup):
"""
click multicommand at the python file layer, subcommands should be all the workflows in the file.
"""
Expand Down Expand Up @@ -678,7 +678,7 @@ def get_command(self, ctx, exe_entity):
return cmd


class RunCommand(click.MultiCommand):
class RunCommand(click.RichGroup):
"""
A click command group for registering and executing flyte workflows & tasks in a file.
"""
Expand Down
10 changes: 5 additions & 5 deletions flytekit/clis/sdk_in_container/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing
from enum import Enum as _Enum

import click
import rich_click as click

from flytekit.clis.sdk_in_container import constants
from flytekit.clis.sdk_in_container.constants import CTX_PACKAGES
Expand Down Expand Up @@ -69,7 +69,7 @@ def serialize_all(
serialize_to_folder(pkgs, serialization_settings, local_source_root, folder)


@click.group("serialize")
@click.group("serialize", cls=click.RichGroup)
@click.option(
"--image",
required=False,
Expand Down Expand Up @@ -124,7 +124,7 @@ def serialize(ctx, image, local_source_root, in_container_config_path, in_contai
ctx.obj[CTX_PYTHON_INTERPRETER] = sys.executable


@click.command("workflows")
@click.command("workflows", cls=click.RichCommand)
# For now let's just assume that the directory needs to exist. If you're docker run -v'ing, docker will create the
# directory for you so it shouldn't be a problem.
@click.option("-f", "--folder", type=click.Path(exists=True))
Expand All @@ -148,13 +148,13 @@ def workflows(ctx, folder=None):
)


@click.group("fast")
@click.group("fast", cls=click.RichGroup)
@click.pass_context
def fast(ctx):
pass


@click.command("workflows")
@click.command("workflows", cls=click.RichCommand)
@click.option(
"--deref-symlinks",
default=False,
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"gitpython",
"kubernetes>=12.0.1",
"rich",
"rich_click",
],
extras_require=extras_require,
scripts=[
Expand Down