From cad7e5e0631717f83b942d66295a0e09b4a76e67 Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Mon, 4 Dec 2023 13:40:04 -0600 Subject: [PATCH] fix imports for Server --- src/engine/src/core/{server => }/Server.py | 2 +- src/engine/src/core/server/__init__.py | 3 --- src/engine/src/core/{server => workers}/Worker.py | 0 src/engine/src/core/{server => workers}/WorkerPool.py | 0 src/engine/src/core/workers/__init__.py | 2 ++ src/engine/src/core/workflows/WorkflowExecutor.py | 2 +- src/engine/src/main.py | 2 +- src/engine/src/tests/testserver.py | 6 +++--- 8 files changed, 8 insertions(+), 9 deletions(-) rename src/engine/src/core/{server => }/Server.py (99%) delete mode 100644 src/engine/src/core/server/__init__.py rename src/engine/src/core/{server => workers}/Worker.py (100%) rename src/engine/src/core/{server => workers}/WorkerPool.py (100%) create mode 100644 src/engine/src/core/workers/__init__.py diff --git a/src/engine/src/core/server/Server.py b/src/engine/src/core/Server.py similarity index 99% rename from src/engine/src/core/server/Server.py rename to src/engine/src/core/Server.py index d72a3958..48551a98 100644 --- a/src/engine/src/core/server/Server.py +++ b/src/engine/src/core/Server.py @@ -34,7 +34,7 @@ ) from owe_python_sdk.schema import WorkflowSubmissionRequest, EmptyObject -from core.server import WorkerPool +from core.workers import WorkerPool from core.workflows import WorkflowExecutor from utils import bytes_to_json, load_plugins, lbuffer_str as lbuf from errors import NoAvailableWorkers, WorkflowTerminated diff --git a/src/engine/src/core/server/__init__.py b/src/engine/src/core/server/__init__.py deleted file mode 100644 index 8a9fc4b7..00000000 --- a/src/engine/src/core/server/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from core.server.Server import Server -from core.server.Worker import Worker -from core.server.WorkerPool import WorkerPool \ No newline at end of file diff --git a/src/engine/src/core/server/Worker.py b/src/engine/src/core/workers/Worker.py similarity index 100% rename from src/engine/src/core/server/Worker.py rename to src/engine/src/core/workers/Worker.py diff --git a/src/engine/src/core/server/WorkerPool.py b/src/engine/src/core/workers/WorkerPool.py similarity index 100% rename from src/engine/src/core/server/WorkerPool.py rename to src/engine/src/core/workers/WorkerPool.py diff --git a/src/engine/src/core/workers/__init__.py b/src/engine/src/core/workers/__init__.py new file mode 100644 index 00000000..a7123f0d --- /dev/null +++ b/src/engine/src/core/workers/__init__.py @@ -0,0 +1,2 @@ +from core.workers.Worker import Worker +from core.workers.WorkerPool import WorkerPool \ No newline at end of file diff --git a/src/engine/src/core/workflows/WorkflowExecutor.py b/src/engine/src/core/workflows/WorkflowExecutor.py index 8fe8e33c..264ad151 100644 --- a/src/engine/src/core/workflows/WorkflowExecutor.py +++ b/src/engine/src/core/workflows/WorkflowExecutor.py @@ -29,7 +29,7 @@ ) from core.middleware.archivers import S3Archiver, IRODSArchiver from conf.constants import BASE_WORK_DIR -from core.server import Worker +from core.workers import Worker from core.state import Hook, method_hook from core.workflows import params_validator diff --git a/src/engine/src/main.py b/src/engine/src/main.py index db810adf..1f619c2b 100644 --- a/src/engine/src/main.py +++ b/src/engine/src/main.py @@ -1,6 +1,6 @@ import sys, logging -from core.server import Server +from core.Server import Server # Set all third-party library loggers to critical diff --git a/src/engine/src/tests/testserver.py b/src/engine/src/tests/testserver.py index f6fdaa6c..8a522f31 100644 --- a/src/engine/src/tests/testserver.py +++ b/src/engine/src/tests/testserver.py @@ -1,13 +1,13 @@ import sys import unittest -# from core.server import Server +from core.Server import Server class TestServer(unittest.TestCase): def testServerInit(self): - # self.server = Server() - # self.assertEqual(self.server, type(Server)) + self.server = Server() + self.assertEqual(type(self.server), Server) pass if __name__ == "__main__":