diff --git a/.flake8 b/.flake8 index 3ab7540..c91f071 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,4 @@ [flake8] ignore = E203, E266, W503, E402 max-line-length = 88 +exclude = .venv diff --git a/bentoctl/cli/__init__.py b/bentoctl/cli/__init__.py index e85fa24..0f6ebf3 100644 --- a/bentoctl/cli/__init__.py +++ b/bentoctl/cli/__init__.py @@ -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 @@ -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( @@ -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", @@ -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", @@ -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", @@ -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 diff --git a/bentoctl/utils/usage_stats.py b/bentoctl/utils/usage_stats.py index 38a3b56..3b1d1f3 100644 --- a/bentoctl/utils/usage_stats.py +++ b/bentoctl/utils/usage_stats.py @@ -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"