From cc9dadb193f22b05e73132ca81815d2551373129 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Wed, 31 Jul 2024 23:43:55 +0000 Subject: [PATCH] format --- sky/api/cli.py | 7 +++++-- sky/backends/backend_utils.py | 5 +++-- sky/skypilot_config.py | 1 - 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sky/api/cli.py b/sky/api/cli.py index a509b520301..e5f2b1ee526 100644 --- a/sky/api/cli.py +++ b/sky/api/cli.py @@ -34,6 +34,7 @@ import sys import textwrap import time +import types import typing from typing import Any, Dict, List, Optional, Tuple, Union import webbrowser @@ -54,7 +55,7 @@ from sky import serve as serve_lib from sky import sky_logging from sky.adaptors import common as adaptors_common -from sky.api import sdk +from sky.api import sdk as sdk_lib from sky.backends import backend_utils from sky.benchmark import benchmark_state from sky.benchmark import benchmark_utils @@ -104,11 +105,13 @@ _DAG_NOT_SUPPORTED_MESSAGE = ('YAML specifies a DAG which is only supported by ' '`sky jobs launch`. `{command}` supports a ' 'single task only.') - +sdk: types.ModuleType if env_options.Options.get(env_options.Options.CLI_LOCAL_MODE): from sky import core setattr(core, 'get', lambda args: args) sdk = core +else: + sdk = sdk_lib def _get_glob_clusters(clusters: List[str], silent: bool = False) -> List[str]: """Returns a list of clusters that match the glob pattern.""" diff --git a/sky/backends/backend_utils.py b/sky/backends/backend_utils.py index 975444e8e50..08358c22490 100644 --- a/sky/backends/backend_utils.py +++ b/sky/backends/backend_utils.py @@ -2778,8 +2778,9 @@ def get_endpoints(cluster_name: str, launched_resources, {clouds.CloudImplementationFeatures.OPEN_PORTS}) except exceptions.NotSupportedError: with ux_utils.print_exception_no_traceback(): - raise ValueError('Querying endpoints is not supported ' - f'for cluster {cluster_name!r} on {cloud}.') from None + raise ValueError( + 'Querying endpoints is not supported ' + f'for cluster {cluster_name!r} on {cloud}.') from None config = common_utils.read_yaml(handle.cluster_yaml) port_details = provision_lib.query_ports(repr(cloud), diff --git a/sky/skypilot_config.py b/sky/skypilot_config.py index aa3d0a13849..52e1d0ae3d9 100644 --- a/sky/skypilot_config.py +++ b/sky/skypilot_config.py @@ -58,7 +58,6 @@ from sky import sky_logging from sky.skylet import constants from sky.utils import common_utils -from sky.utils import registry from sky.utils import schemas from sky.utils import ux_utils