From 29e851575b81532fb7282f67671abcac4d27e2fd Mon Sep 17 00:00:00 2001 From: zyxue Date: Thu, 4 Feb 2021 11:04:42 -0800 Subject: [PATCH] updated setup_linter fmt lint targets --- operator/hack/create_graph_openapi_schema.py | 5 +++-- operator/hack/csv_hack.py | 7 +++++-- operator/helm/split_resources.py | 1 + python/Makefile | 10 ++++++++-- python/setup.py | 1 + 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/operator/hack/create_graph_openapi_schema.py b/operator/hack/create_graph_openapi_schema.py index 3e3cb52a41..ffebaaa827 100644 --- a/operator/hack/create_graph_openapi_schema.py +++ b/operator/hack/create_graph_openapi_schema.py @@ -1,7 +1,8 @@ import argparse -import yaml -import sys import copy +import sys + +import yaml def getOpts(cmd_line_args): diff --git a/operator/hack/csv_hack.py b/operator/hack/csv_hack.py index a0b711d19c..2baf89573d 100644 --- a/operator/hack/csv_hack.py +++ b/operator/hack/csv_hack.py @@ -1,7 +1,8 @@ -import yaml import argparse import sys +import yaml + def getOpts(cmd_line_args): parser = argparse.ArgumentParser( @@ -20,7 +21,9 @@ def remove_versions(csv): def update_container_image(csv, version): - csv["metadata"]["annotations"]["containerImage"] = "seldonio/seldon-core-operator:"+version + csv["metadata"]["annotations"]["containerImage"] = ( + "seldonio/seldon-core-operator:" + version + ) return csv diff --git a/operator/helm/split_resources.py b/operator/helm/split_resources.py index c32e4c5f3b..f7569c652a 100644 --- a/operator/helm/split_resources.py +++ b/operator/helm/split_resources.py @@ -1,6 +1,7 @@ import argparse import glob import re + import yaml parser = argparse.ArgumentParser() diff --git a/python/Makefile b/python/Makefile index 734946206f..7766b42930 100644 --- a/python/Makefile +++ b/python/Makefile @@ -95,17 +95,23 @@ push_conda: @echo "Alternatively use anaconda upload to publish on own channel" setup_linter: - pip install black==20.8b1 + pip install black==20.8b1 isort==5.7.0 fmt: black \ ./ ../testing ../operator/helm ../operator/hack \ - --exclude "(testing/scripts/proto|seldon_core/proto/|.eggs|.tox)" + --exclude "(testing|scripts|proto|seldon_core/proto/|.eggs|.tox)" + isort \ + ./ ../testing ../operator/helm ../operator/hack \ + --skip testing --skip scripts --skip proto --skip seldon_core/proto --skip .eggs --skip .tox lint: licenses black \ --check ./ ../testing \ --exclude "(testing/scripts/proto|seldon_core/proto/|.eggs|.tox)" + isort \ + --check-only ./ ../testing \ + --skip testing --skip scripts --skip proto --skip seldon_core/proto --skip .eggs --skip .tox flake8 # Check if licenses have changed git \ diff --git a/python/setup.py b/python/setup.py index 8e7315f957..9ac3ddb069 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,5 +1,6 @@ import os from itertools import chain + from setuptools import find_packages, setup # Extra dependencies, with special 'all' key