Skip to content

Commit

Permalink
format the python files with yapf (kubeflow#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitake authored and Jiayu Liu committed Mar 7, 2018
1 parent 73771f2 commit c378f12
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
9 changes: 6 additions & 3 deletions py/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,20 @@ def main(): # pylint: disable=too-many-locals

parser_setup.add_argument(
"--test_app_dir",
help="The directory containing the ksonnet app used for testing.",)
help="The directory containing the ksonnet app used for testing.",
)

now = datetime.datetime.now()
parser_setup.add_argument(
"--namespace",
default="kubeflow-" + now.strftime("%m%d-%H%M-") + uuid.uuid4().hex[0:4],
help="The directory containing the ksonnet app used for testing.",)
help="The directory containing the ksonnet app used for testing.",
)

parser_setup.add_argument(
"--image",
help="The image to use",)
help="The image to use",
)

#############################################################################
# teardown
Expand Down
15 changes: 8 additions & 7 deletions py/release_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ class ReleaseTest(unittest.TestCase):
@mock.patch("py.release.util.clone_repo")
@mock.patch("py.release.build_and_push")
def test_build_postsubmit( # pylint: disable=no-self-use
self,
mock_build_and_push,
mock_clone,
_mock_install,
_mock_os,
self, mock_build_and_push, mock_clone, _mock_install, _mock_os,
_mock_makedirs):
# Make sure REPO_OWNER and REPO_NAME aren't changed by the environment
release.REPO_ORG = "kubeflow"
Expand All @@ -40,8 +36,13 @@ def test_build_postsubmit( # pylint: disable=no-self-use
@mock.patch("py.release.util.install_go_deps")
@mock.patch("py.release.util.clone_repo")
@mock.patch("py.release.build_and_push")
def test_build_pr(self, mock_build_and_push, mock_clone, _mock_install, # pylint: disable=no-self-use
_mock_os, _mock_makedirs):
def test_build_pr(
self,
mock_build_and_push,
mock_clone,
_mock_install, # pylint: disable=no-self-use
_mock_os,
_mock_makedirs):
parser = release.build_parser()
args = parser.parse_args(
["pr", "--pr=10", "--commit=22", "--src_dir=/top/src_dir"])
Expand Down
13 changes: 6 additions & 7 deletions py/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ def wait_for_deployment(api_client, namespace, name):

logging.error("Timeout waiting for deployment %s in namespace %s to be "
"ready", name, namespace)
raise TimeoutError("Timeout waiting for deployment {0} in namespace {1}".
format(name, namespace))

raise TimeoutError(
"Timeout waiting for deployment {0} in namespace {1}".format(
name, namespace))


def wait_for_statefulset(api_client, namespace, name):
Expand Down Expand Up @@ -330,9 +330,9 @@ def wait_for_statefulset(api_client, namespace, name):

logging.error("Timeout waiting for statefulset %s in namespace %s to be "
"ready", name, namespace)
raise TimeoutError("Timeout waiting for statefulset {0} in namespace {1}".
format(name, namespace))

raise TimeoutError(
"Timeout waiting for statefulset {0} in namespace {1}".format(
name, namespace))


def install_gpu_drivers(api_client):
Expand Down Expand Up @@ -390,7 +390,6 @@ def cluster_has_gpu_nodes(api_client):
return False



def setup_cluster(api_client):
"""Setup a cluster.
Expand Down

0 comments on commit c378f12

Please sign in to comment.