chore: mypy, ruff, extract, openapi, and recipes-scraper updates (#1968)

* bump ruff and mypy

* mypy fixes

* bump and fix openapi

* drop debug statement

* bump extruct

* bump recipes-scrapers
This commit is contained in:
Hayden
2023-01-01 14:47:27 -08:00
committed by GitHub
parent e329e1cd15
commit 4d5550ad85
27 changed files with 173 additions and 135 deletions

View File

@@ -23,7 +23,7 @@ class BaseMixins:
self.__init__(*args, **kwarg)
@classmethod
def get_ref(cls, match_value: str, match_attr: str = None, session: Session = None):
def get_ref(cls, match_value: str, match_attr: str | None = None, session: Session | None = None):
match_attr = match_attr or cls.Config.get_attr # type: ignore
if match_value is None or session is None:

View File

@@ -136,12 +136,12 @@ class RecipeModel(SqlAlchemyBase, BaseMixins):
def __init__(
self,
session,
assets: list = None,
notes: list[dict] = None,
nutrition: dict = None,
recipe_ingredient: list[dict] = None,
recipe_instructions: list[dict] = None,
settings: dict = None,
assets: list | None = None,
notes: list[dict] | None = None,
nutrition: dict | None = None,
recipe_ingredient: list[dict] | None = None,
recipe_instructions: list[dict] | None = None,
settings: dict | None = None,
**_,
) -> None:
self.nutrition = Nutrition(**nutrition) if nutrition else Nutrition()

View File

@@ -71,7 +71,7 @@ class User(SqlAlchemyBase, BaseMixins):
}
@auto_init()
def __init__(self, session, full_name, password, group: str = None, **kwargs) -> None:
def __init__(self, session, full_name, password, group: str | None = None, **kwargs) -> None:
if group is None:
settings = get_app_settings()
group = settings.DEFAULT_GROUP