From 7836e2d168390a788206626012f4010659b71b2b Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 17 Oct 2023 18:54:12 -0600 Subject: [PATCH] Fix some imports Signed-off-by: Zack Cerza --- src/teuthology_api/main.py | 3 ++- src/teuthology_api/routes/kill.py | 8 +++++--- src/teuthology_api/routes/suite.py | 10 ++++++---- src/teuthology_api/schemas/kill.py | 2 +- src/teuthology_api/schemas/schedule.py | 2 +- src/teuthology_api/schemas/suite.py | 2 +- src/teuthology_api/services/helpers.py | 7 +++++-- src/teuthology_api/services/kill.py | 6 ++++-- src/teuthology_api/services/suite.py | 4 +++- 9 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/teuthology_api/main.py b/src/teuthology_api/main.py index b04fba8..598e286 100644 --- a/src/teuthology_api/main.py +++ b/src/teuthology_api/main.py @@ -3,9 +3,10 @@ from fastapi import FastAPI, Request from fastapi.middleware.cors import CORSMiddleware from starlette.middleware.sessions import SessionMiddleware -from routes import suite, kill, login, logout from dotenv import load_dotenv +from teuthology_api.routes import suite, kill, login, logout + load_dotenv() DEPLOYMENT = os.getenv("DEPLOYMENT") diff --git a/src/teuthology_api/routes/kill.py b/src/teuthology_api/routes/kill.py index 8f6412a..9062f7e 100644 --- a/src/teuthology_api/routes/kill.py +++ b/src/teuthology_api/routes/kill.py @@ -1,8 +1,10 @@ import logging + from fastapi import APIRouter, Depends, Request -from services.kill import run -from services.helpers import get_token -from schemas.kill import KillArgs + +from teuthology_api.services.kill import run +from teuthology_api.services.helpers import get_token +from teuthology_api.schemas.kill import KillArgs log = logging.getLogger(__name__) diff --git a/src/teuthology_api/routes/suite.py b/src/teuthology_api/routes/suite.py index e803879..8233ecf 100644 --- a/src/teuthology_api/routes/suite.py +++ b/src/teuthology_api/routes/suite.py @@ -1,9 +1,11 @@ -from fastapi import APIRouter, HTTPException, Depends -from services.suite import run -from services.helpers import get_token -from schemas.suite import SuiteArgs import logging +from fastapi import APIRouter, HTTPException, Depends + +from teuthology_api.services.suite import run +from teuthology_api.services.helpers import get_token +from teuthology_api.schemas.suite import SuiteArgs + log = logging.getLogger(__name__) router = APIRouter( diff --git a/src/teuthology_api/schemas/kill.py b/src/teuthology_api/schemas/kill.py index 267cfe3..772e1e5 100644 --- a/src/teuthology_api/schemas/kill.py +++ b/src/teuthology_api/schemas/kill.py @@ -1,7 +1,7 @@ from typing import Union from pydantic import Field -from .base import BaseArgs +from teuthology_api.schemas.base import BaseArgs class KillArgs(BaseArgs): diff --git a/src/teuthology_api/schemas/schedule.py b/src/teuthology_api/schemas/schedule.py index c337d7a..4eaeb54 100644 --- a/src/teuthology_api/schemas/schedule.py +++ b/src/teuthology_api/schemas/schedule.py @@ -1,7 +1,7 @@ from typing import Union from pydantic import Field -from .base import BaseArgs +from teuthology_api.schemas.base import BaseArgs class SchedulerArgs(BaseArgs): diff --git a/src/teuthology_api/schemas/suite.py b/src/teuthology_api/schemas/suite.py index ee90db1..409e219 100644 --- a/src/teuthology_api/schemas/suite.py +++ b/src/teuthology_api/schemas/suite.py @@ -1,7 +1,7 @@ from typing import Union from pydantic import Field -from .base import BaseArgs +from teuthology_api.schemas.base import BaseArgs class SuiteArgs(BaseArgs): diff --git a/src/teuthology_api/services/helpers.py b/src/teuthology_api/services/helpers.py index a17d542..8864d7b 100644 --- a/src/teuthology_api/services/helpers.py +++ b/src/teuthology_api/services/helpers.py @@ -2,11 +2,14 @@ import logging import os import uuid -from config import settings + from fastapi import HTTPException, Request -from requests.exceptions import HTTPError + +from teuthology_api.config import settings + import teuthology import requests # Note: import requests after teuthology +from requests.exceptions import HTTPError PADDLES_URL = os.getenv("PADDLES_URL") diff --git a/src/teuthology_api/services/kill.py b/src/teuthology_api/services/kill.py index 053e95a..aa1b157 100644 --- a/src/teuthology_api/services/kill.py +++ b/src/teuthology_api/services/kill.py @@ -1,8 +1,10 @@ -from fastapi import HTTPException, Request -from services.helpers import logs_run, get_username, get_run_details import teuthology.kill import logging +from fastapi import HTTPException, Request + +from teuthology_api.services.helpers import logs_run, get_username, get_run_details + log = logging.getLogger(__name__) diff --git a/src/teuthology_api/services/suite.py b/src/teuthology_api/services/suite.py index bfe09c1..7e251da 100644 --- a/src/teuthology_api/services/suite.py +++ b/src/teuthology_api/services/suite.py @@ -1,8 +1,10 @@ from datetime import datetime import logging import teuthology.suite + from fastapi import HTTPException -from services.helpers import logs_run, get_run_details + +from teuthology_api.services.helpers import logs_run, get_run_details log = logging.getLogger(__name__)