From 8a04c115c07b80a95016e76cf348667533aa84f8 Mon Sep 17 00:00:00 2001 From: Youhwan Seol Date: Tue, 15 Nov 2022 17:35:41 +0900 Subject: [PATCH] revert relative import Signed-off-by: Youhwan Seol Change-Id: I3ff68fb2dceb9449a68298678c9787ea3de9bdeb --- kfadapter/__init__.py | 17 ----------------- kfadapter/kfadapter_conf.py | 4 ++-- kfadapter/kfadapter_kfconnect.py | 4 ++-- kfadapter/kfadapter_main.py | 6 +++--- kfadapter/kfadapter_util.py | 2 ++ test/test_tmgr_logger.py | 2 +- test/unit_test.sh | 2 +- 7 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 kfadapter/__init__.py diff --git a/kfadapter/__init__.py b/kfadapter/__init__.py deleted file mode 100644 index 7954d16..0000000 --- a/kfadapter/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# ================================================================================== -# -# Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# ================================================================================== diff --git a/kfadapter/kfadapter_conf.py b/kfadapter/kfadapter_conf.py index f4a3a50..bdebc51 100644 --- a/kfadapter/kfadapter_conf.py +++ b/kfadapter/kfadapter_conf.py @@ -27,7 +27,7 @@ Application configuration - Application Port and run status interval from os import getenv from threading import Lock -from .tmgr_logger import TMLogger +from tmgr_logger import TMLogger TRAINING_DICT = {} LOCK = Lock() @@ -65,7 +65,7 @@ class KfConfiguration: self.kf_dict = {} self.trainingmgr_dict = {} - self.tmgr_logger = TMLogger("config/log_config.yaml") + self.tmgr_logger = TMLogger("../config/log_config.yaml") self.logger = self.tmgr_logger.logger self.run_status_polling_interval_sec = 20 diff --git a/kfadapter/kfadapter_kfconnect.py b/kfadapter/kfadapter_kfconnect.py index 32f06f7..c21ce45 100644 --- a/kfadapter/kfadapter_kfconnect.py +++ b/kfadapter/kfadapter_kfconnect.py @@ -22,8 +22,8 @@ This module is for interfacing and interworking with KubeFlow SDK """ import kfp -from .kfadapter_util import random_suffix -from .kfadapter_conf import KfConfiguration +from kfadapter_util import random_suffix +from kfadapter_conf import KfConfiguration class KfConnect: """ diff --git a/kfadapter/kfadapter_main.py b/kfadapter/kfadapter_main.py index 5191ad8..7199f69 100644 --- a/kfadapter/kfadapter_main.py +++ b/kfadapter/kfadapter_main.py @@ -35,9 +35,9 @@ from flask import Flask, request, jsonify from flask_api import status import kfp_server_api -from . import kfadapter_conf -from .kfadapter_kfconnect import KfConnect -from .kfadapter_util import BadRequest, wait_status_thread, keys_match, check_map +import kfadapter_conf +from kfadapter_kfconnect import KfConnect +from kfadapter_util import BadRequest, wait_status_thread, keys_match, check_map #Handles to Config and Kubeflow KFCONNECT_CONFIG_OBJ = None diff --git a/kfadapter/kfadapter_util.py b/kfadapter/kfadapter_util.py index baaba3a..ad0b60d 100644 --- a/kfadapter/kfadapter_util.py +++ b/kfadapter/kfadapter_util.py @@ -31,6 +31,8 @@ from random import choices from flask_api import status +import kfadapter_conf + class BadRequest(Exception): """ This is a class for throwing custom exception when local error occurs diff --git a/test/test_tmgr_logger.py b/test/test_tmgr_logger.py index 11aaa8a..4589a96 100644 --- a/test/test_tmgr_logger.py +++ b/test/test_tmgr_logger.py @@ -20,7 +20,7 @@ from kfadapter.tmgr_logger import TMLogger class Test_tmgr_logger: def setup_method(self): - self.TMGR_LOGGER_OBJ = TMLogger("config/log_config.yaml") + self.TMGR_LOGGER_OBJ = TMLogger("../config/log_config.yaml") def test_get_loglevel(self): ret = self.TMGR_LOGGER_OBJ.get_logLevel diff --git a/test/unit_test.sh b/test/unit_test.sh index bdf69b5..2c2be5c 100755 --- a/test/unit_test.sh +++ b/test/unit_test.sh @@ -18,4 +18,4 @@ #!/bin/bash -python3 -m pytest +python3 -m pytest ../test -- 2.16.6