mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-06 07:53:11 -05:00
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:
@@ -36,7 +36,7 @@ def controller(router: APIRouter, *urls: str) -> Callable[[type[T]], type[T]]:
|
||||
return decorator
|
||||
|
||||
|
||||
def _cbv(router: APIRouter, cls: type[T], *urls: str, instance: Any = None) -> type[T]:
|
||||
def _cbv(router: APIRouter, cls: type[T], *urls: str, instance: Any | None = None) -> type[T]:
|
||||
"""
|
||||
Replaces any methods of the provided class `cls` that are endpoints of routes in `router` with updated
|
||||
function calls that will properly inject an instance of `cls`.
|
||||
@@ -46,7 +46,7 @@ def _cbv(router: APIRouter, cls: type[T], *urls: str, instance: Any = None) -> t
|
||||
return cls
|
||||
|
||||
|
||||
def _init_cbv(cls: type[Any], instance: Any = None) -> None:
|
||||
def _init_cbv(cls: type[Any], instance: Any | None = None) -> None:
|
||||
"""
|
||||
Idempotently modifies the provided `cls`, performing the following modifications:
|
||||
* The `__init__` function is updated to set any class-annotated dependencies as instance attributes
|
||||
|
||||
@@ -34,8 +34,8 @@ class HttpRepo(Generic[C, R, U]):
|
||||
self,
|
||||
repo: RepositoryGeneric,
|
||||
logger: Logger,
|
||||
exception_msgs: Callable[[type[Exception]], str] = None,
|
||||
default_message: str = None,
|
||||
exception_msgs: Callable[[type[Exception]], str] | None = None,
|
||||
default_message: str | None = None,
|
||||
) -> None:
|
||||
|
||||
self.repo = repo
|
||||
@@ -72,7 +72,7 @@ class HttpRepo(Generic[C, R, U]):
|
||||
|
||||
return item
|
||||
|
||||
def get_one(self, item_id: int | str | UUID4, key: str = None) -> R:
|
||||
def get_one(self, item_id: int | str | UUID4, key: str | None = None) -> R:
|
||||
item = self.repo.get_one(item_id, key)
|
||||
|
||||
if not item:
|
||||
|
||||
Reference in New Issue
Block a user