Migrate to ruff

This commit is contained in:
2023-01-07 23:57:48 +01:00
parent f9d701ec3b
commit 1f18897dc3
16 changed files with 1136 additions and 723 deletions

View File

@@ -1,13 +1,12 @@
from fastapi import FastAPI
from fastapi.responses import ORJSONResponse
from prometheus_fastapi_instrumentator import Instrumentator
from app.views import router, healthcheck_router
import core.sentry # noqa: F401
from app.views import healthcheck_router, router
from core.arq_pool import get_arq_pool
from core.db import database
from core.redis_client import get_client
import core.sentry # noqa: F401
def start_app() -> FastAPI:

View File

@@ -1,5 +1,5 @@
from arq.connections import create_pool, RedisSettings, ArqRedis
import msgpack
from arq.connections import ArqRedis, RedisSettings, create_pool
from core.config import env_config

View File

@@ -1,4 +1,3 @@
from fastapi.security import APIKeyHeader
default_security = APIKeyHeader(name="Authorization")

View File

@@ -5,7 +5,6 @@ from sqlalchemy import MetaData
from core.config import env_config
DATABASE_URL = (
f"postgresql://{env_config.POSTGRES_USER}:{quote(env_config.POSTGRES_PASSWORD)}@"
f"{env_config.POSTGRES_HOST}:{env_config.POSTGRES_PORT}/{env_config.POSTGRES_DB}"

View File

@@ -2,7 +2,6 @@ import sentry_sdk
from core.config import env_config
sentry_sdk.init(
env_config.SENTRY_DSN,
)

View File

@@ -1,14 +1,14 @@
import msgpack
import core.sentry # noqa: F401
from app.services.cache_updater import (
check_books,
cache_file_by_book_id,
check_books,
check_books_page,
)
from core.arq_pool import get_redis_settings, get_arq_pool
from core.arq_pool import get_arq_pool, get_redis_settings
from core.db import database
from core.redis_client import get_client
import core.sentry # noqa: F401
async def startup(ctx):