Skip to content

Commit

Permalink
Fix some imports
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Cerza <[email protected]>
  • Loading branch information
zmc committed Oct 18, 2023
1 parent 077f694 commit 7836e2d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/teuthology_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 5 additions & 3 deletions src/teuthology_api/routes/kill.py
Original file line number Diff line number Diff line change
@@ -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__)

Expand Down
10 changes: 6 additions & 4 deletions src/teuthology_api/routes/suite.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/teuthology_api/schemas/kill.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/teuthology_api/schemas/schedule.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/teuthology_api/schemas/suite.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
7 changes: 5 additions & 2 deletions src/teuthology_api/services/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 4 additions & 2 deletions src/teuthology_api/services/kill.py
Original file line number Diff line number Diff line change
@@ -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__)

Expand Down
4 changes: 3 additions & 1 deletion src/teuthology_api/services/suite.py
Original file line number Diff line number Diff line change
@@ -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__)

Expand Down

0 comments on commit 7836e2d

Please sign in to comment.