Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Jul 21, 2023
1 parent 394db78 commit ad20851
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[flake8]
ignore = E203, E266, W503, E402
max-line-length = 88
exclude = .venv
29 changes: 20 additions & 9 deletions bentoctl/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from bentoml_cli.utils import validate_docker_tag
except ImportError:
logger.warning(
"'bentoml._internal.utils.docker.validate_tag not imported. Validation dissabled"
"'bentoml._internal.utils.docker.validate_tag' not imported. "
"Validation dissabled."
)
validate_docker_tag = None

Expand Down Expand Up @@ -156,7 +157,8 @@ def generate(deployment_config_file, values_only, save_path):
"--allow",
multiple=True,
default=None,
help="Allow extra privileged entitlement (e.g., 'network.host', 'security.insecure').",
help="Allow extra privileged entitlement "
"(e.g., 'network.host', 'security.insecure').",
)
@click.option("--build-arg", multiple=True, help="Set build-time variables.")
@click.option(
Expand All @@ -174,19 +176,22 @@ def generate(deployment_config_file, values_only, save_path):
"--cache-from",
multiple=True,
default=None,
help="External cache sources (e.g., 'user/app:cache', 'type=local,src=path/to/dir').",
help="External cache sources "
"(e.g., 'user/app:cache', 'type=local,src=path/to/dir').",
)
@click.option(
"--cache-to",
multiple=True,
default=None,
help="Cache export destinations (e.g., 'user/app:cache', 'type=local,dest=path/to/dir').",
help="Cache export destinations "
"(e.g., 'user/app:cache', 'type=local,dest=path/to/dir').",
)
@click.option(
"--load",
is_flag=True,
default=True,
help="Shorthand for '--output=type=docker'. Note that '--push' and '--load' are mutually exclusive.",
help="Shorthand for '--output=type=docker'. "
"Note that '--push' and '--load' are mutually exclusive.",
)
@click.option(
"--no-cache",
Expand All @@ -210,7 +215,8 @@ def generate(deployment_config_file, values_only, save_path):
"--progress",
default="auto",
type=click.Choice(["auto", "tty", "plain"]),
help="Set type of progress output ('auto', 'plain', 'tty'). Use plain to show container output.",
help="Set type of progress output ('auto', 'plain', 'tty'). "
"Use plain to show container output.",
)
@click.option(
"--pull",
Expand All @@ -222,7 +228,8 @@ def generate(deployment_config_file, values_only, save_path):
"--push",
is_flag=True,
default=False,
help="Shorthand for '--output=type=registry'. Note that '--push' and '--load' are mutually exclusive.",
help="Shorthand for '--output=type=registry'. "
"Note that '--push' and '--load' are mutually exclusive.",
)
@click.option(
"--target",
Expand Down Expand Up @@ -293,11 +300,15 @@ def build(
if platform and len(platform) > 1:
if not push:
click.echo(
"Multiple '--platform' arguments were found. Make sure to also use '--push' to push images to a repository or generated images will not be saved. For more information, see https://docs.docker.com/engine/reference/commandline/buildx_build/#load."
"Multiple '--platform' arguments were found. "
"Make sure to also use '--push' to push images to a repository or "
"generated images will not be saved. For more information, see "
"https://docs.docker.com/engine/reference/commandline/buildx_build/#load." # noqa: E501
)
if push:
click.echo(
"'--push' flag detected. bentoctl will not attempt to create repository and push image into it."
"'--push' flag detected. bentoctl will not attempt to "
"create repository and push image into it."
)
load = False
dry_run = True
Expand Down
6 changes: 4 additions & 2 deletions bentoctl/utils/usage_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

@lru_cache(maxsize=1)
def do_not_track() -> bool: # pragma: no cover
# Returns True if and only if the environment variable is defined and has value True.
# The function is cached for better performance.
"""
Returns True if and only if the environment variable is defined and has value True.
The function is cached for better performance.
"""
return os.environ.get(BENTOML_DO_NOT_TRACK, str(False)).lower() == "true"


Expand Down

0 comments on commit ad20851

Please sign in to comment.