diff --git a/base.py b/base.py index dbf9ee3..c5c5828 100644 --- a/base.py +++ b/base.py @@ -8,8 +8,6 @@ from fastapi import FastAPI, Request from fastapi.middleware.cors import CORSMiddleware from lyric_search.sources import redis_cache - - logger = logging.getLogger() logger.setLevel(logging.INFO) diff --git a/endpoints/ai.py b/endpoints/ai.py index 92701e1..5411de6 100644 --- a/endpoints/ai.py +++ b/endpoints/ai.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import logging import regex from regex import Pattern diff --git a/endpoints/constructors.py b/endpoints/constructors.py index 0ddc295..f721107 100644 --- a/endpoints/constructors.py +++ b/endpoints/constructors.py @@ -1,11 +1,6 @@ -#!/usr/bin/env python3.12 - from typing import Optional from pydantic import BaseModel -# Constructors -# TODO: REORDER - """ Karma """ diff --git a/endpoints/karma.py b/endpoints/karma.py index 2476599..f161b0a 100644 --- a/endpoints/karma.py +++ b/endpoints/karma.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import os import logging import time diff --git a/endpoints/lastfm.py b/endpoints/lastfm.py index 2f10dcf..bcd967a 100644 --- a/endpoints/lastfm.py +++ b/endpoints/lastfm.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import importlib import traceback from typing import Optional, Union diff --git a/endpoints/lyric_search.py b/endpoints/lyric_search.py index 0d08ae8..599c861 100644 --- a/endpoints/lyric_search.py +++ b/endpoints/lyric_search.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import logging import os import urllib.parse diff --git a/endpoints/misc.py b/endpoints/misc.py index 5de65c2..37a00da 100644 --- a/endpoints/misc.py +++ b/endpoints/misc.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python3.12 - import time -import logging from typing import Optional from fastapi import FastAPI from fastapi.responses import JSONResponse @@ -86,7 +83,7 @@ class Misc(FastAPI): """ Homepage Lyrics Widget Handler """ - found_counts: dict = await self.redis_cache.get_found_counts() + found_counts: Optional[dict] = await self.redis_cache.get_found_counts() if not isinstance(found_counts, dict): return JSONResponse(status_code=500, content={ 'err': True, diff --git a/endpoints/radio.py b/endpoints/radio.py index 1f408f2..3ffbe4b 100644 --- a/endpoints/radio.py +++ b/endpoints/radio.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import logging import traceback import time diff --git a/endpoints/radio_util.py b/endpoints/radio_util.py index 6f025c5..1350bf9 100644 --- a/endpoints/radio_util.py +++ b/endpoints/radio_util.py @@ -1,9 +1,3 @@ -#!/usr/bin/env python3.12 - -""" -Radio Utils -""" - import logging import traceback import time diff --git a/endpoints/rand_msg.py b/endpoints/rand_msg.py index e739e51..071d707 100644 --- a/endpoints/rand_msg.py +++ b/endpoints/rand_msg.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import os import random from typing import LiteralString, Optional, Union diff --git a/endpoints/transcriptions.py b/endpoints/transcriptions.py index 0156ea7..ca86fb6 100644 --- a/endpoints/transcriptions.py +++ b/endpoints/transcriptions.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import os import aiosqlite as sqlite3 from fastapi import FastAPI diff --git a/endpoints/xc.py b/endpoints/xc.py index cffb0e7..41b5e8b 100644 --- a/endpoints/xc.py +++ b/endpoints/xc.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import logging from typing import Optional from fastapi import FastAPI, Request, HTTPException diff --git a/endpoints/yt.py b/endpoints/yt.py index 29439d3..c7c3abc 100644 --- a/endpoints/yt.py +++ b/endpoints/yt.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import importlib from fastapi import FastAPI from fastapi.responses import JSONResponse diff --git a/gpt/__init__.py b/gpt/__init__.py index 8fc83b9..1867d4f 100644 --- a/gpt/__init__.py +++ b/gpt/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3.12 from typing import Optional from openai import AsyncOpenAI diff --git a/lastfm_wrapper.py b/lastfm_wrapper.py index 77bdb3c..66edad6 100644 --- a/lastfm_wrapper.py +++ b/lastfm_wrapper.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import traceback import logging from typing import Optional, Union diff --git a/lyric_search/constructors.py b/lyric_search/constructors.py index 57013cc..106955e 100644 --- a/lyric_search/constructors.py +++ b/lyric_search/constructors.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - from dataclasses import dataclass from typing import Union diff --git a/lyric_search/sources/aggregate.py b/lyric_search/sources/aggregate.py index 87c39e7..ab2e4db 100644 --- a/lyric_search/sources/aggregate.py +++ b/lyric_search/sources/aggregate.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - from typing import Optional from lyric_search.constructors import LyricsResult from lyric_search import notifier diff --git a/lyric_search/sources/cache.py b/lyric_search/sources/cache.py index adaf02a..e716d88 100644 --- a/lyric_search/sources/cache.py +++ b/lyric_search/sources/cache.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import os import time import regex diff --git a/lyric_search/sources/common.py b/lyric_search/sources/common.py index 87868f5..551f213 100644 --- a/lyric_search/sources/common.py +++ b/lyric_search/sources/common.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3.12 SCRAPE_HEADERS: dict[str, str] = { 'accept': '*/*', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0', diff --git a/lyric_search/sources/genius.py b/lyric_search/sources/genius.py index d3eb68e..68ea638 100644 --- a/lyric_search/sources/genius.py +++ b/lyric_search/sources/genius.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import sys sys.path.insert(1,'..') import traceback @@ -7,7 +5,7 @@ import logging import time from typing import Optional from aiohttp import ClientTimeout, ClientSession -from bs4 import BeautifulSoup, ResultSet +from bs4 import BeautifulSoup, ResultSet # type: ignore import html as htm from . import private, common, cache, redis_cache from lyric_search import utils diff --git a/lyric_search/sources/lrclib.py b/lyric_search/sources/lrclib.py index cc49916..de8c11b 100644 --- a/lyric_search/sources/lrclib.py +++ b/lyric_search/sources/lrclib.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import sys import time sys.path.insert(1,'..') diff --git a/lyric_search/sources/redis_cache.py b/lyric_search/sources/redis_cache.py index ae813aa..f63e4b9 100644 --- a/lyric_search/sources/redis_cache.py +++ b/lyric_search/sources/redis_cache.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - import logging import traceback import json @@ -35,7 +33,7 @@ class RedisCache: def __init__(self) -> None: self.redis_client: redis.Redis = redis.Redis(password=private.REDIS_PW) self.notifier = notifier.DiscordNotifier() - self.notify_warnings = True + self.notify_warnings = False self.regexes: list[Pattern] = [ regex.compile(r'\-'), regex.compile(r'[^a-zA-Z0-9\s]'), diff --git a/lyric_search/utils.py b/lyric_search/utils.py index e4ac70a..291358f 100644 --- a/lyric_search/utils.py +++ b/lyric_search/utils.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3.12 - from difflib import SequenceMatcher from typing import List, Optional, Union, Any import logging diff --git a/mypy.ini b/mypy.ini index a7f647e..090d8ad 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1 +1,2 @@ -[mypy] \ No newline at end of file +[mypy] +ignore_errors = import-untyped \ No newline at end of file