Skip to content

Commit

Permalink
ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybenoy committed Dec 1, 2023
1 parent 274442b commit caefb90
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 14 deletions.
7 changes: 3 additions & 4 deletions alembic/env.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os
from logging.config import fileConfig

from sqlalchemy import engine_from_config
from sqlalchemy import pool
from dotenv import load_dotenv
from sqlalchemy import engine_from_config, pool

from alembic import context
from src.models import * # noqa
from dotenv import load_dotenv
import os

load_dotenv()

Expand Down
2 changes: 1 addition & 1 deletion alembic/versions/cbf112934370_added_s3_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "cbf112934370"
Expand Down
2 changes: 1 addition & 1 deletion src/celery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from celery import Celery
from src.config import Settings

from src.config import Settings

default = Celery("default", broker=Settings.REDIS_URL, backend=Settings.REDIS_URL)
1 change: 1 addition & 0 deletions src/logger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import logging.handlers
import os

from src.config import Settings


Expand Down
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import Dict

from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from src.routes import index, s3

from src.logger import logger
from src.routes import index, s3
from src.utils import get_current_date_time

app = FastAPI()
Expand Down
8 changes: 5 additions & 3 deletions src/models/database.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from datetime import datetime
from typing import Any, Generator
from sqlalchemy import Column, Integer, create_engine, DateTime

from sqlalchemy import Column, DateTime, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, Session
from datetime import datetime
from sqlalchemy.orm import Session, sessionmaker

from src.config import Settings

engine = create_engine(Settings.DATABASE_URL)
Expand Down
1 change: 1 addition & 0 deletions src/models/s3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from sqlalchemy import Column, String

from src.models.database import BaseModel
from src.s3 import get_object_url

Expand Down
1 change: 1 addition & 0 deletions src/redis.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from redis import Redis

from src.config import Settings

redis_conn = Redis(host=Settings.REDIS_HOST, port=Settings.REDIS_PORT, db=Settings.REDIS_DB)
1 change: 1 addition & 0 deletions src/routes/index.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse
from starlette.templating import _TemplateResponse

from src.templates import templates

router = APIRouter()
Expand Down
6 changes: 3 additions & 3 deletions src/routes/s3.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from fastapi import APIRouter, Depends, Request, UploadFile, File
from src.logger import logger
from fastapi import APIRouter, Depends, File, Request, UploadFile

from src.config import Settings
from src.logger import logger
from src.models.database import get_db
from src.models.s3 import S3Object
from src.config import Settings
from src.s3 import upload_object_to_s3

router = APIRouter()
Expand Down
4 changes: 3 additions & 1 deletion src/s3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import uuid

import boto3

from src.config import Settings
from src.logger import logger
import uuid


def get_s3_client():
Expand Down

0 comments on commit caefb90

Please sign in to comment.