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

@@ -51,7 +51,7 @@ class InvalidDomainError(Exception):
class RecipeDataService(BaseService):
minifier: img.ABCMinifier
def __init__(self, recipe_id: UUID4, group_id: UUID4 = None) -> None:
def __init__(self, recipe_id: UUID4, group_id: UUID4 | None = None) -> None:
"""
RecipeDataService is a service that consolidates the reading/writing actions related
to assets, and images for a recipe.

View File

@@ -84,7 +84,7 @@ class RecipeService(BaseService):
self.logger.info(f"Recipe Directory Removed: {recipe.slug}")
@staticmethod
def _recipe_creation_factory(user: PrivateUser, name: str, additional_attrs: dict = None) -> Recipe:
def _recipe_creation_factory(user: PrivateUser, name: str, additional_attrs: dict | None = None) -> Recipe:
"""
The main creation point for recipes. The factor method returns an instance of the
Recipe Schema class with the appropriate defaults set. Recipes should not be created

View File

@@ -96,7 +96,7 @@ class TemplateService(BaseService):
return save_path
def _render_jinja2(self, recipe: Recipe, j2_template: str = None) -> Path:
def _render_jinja2(self, recipe: Recipe, j2_template: str | None = None) -> Path:
"""
Renders a Jinja2 Template in a temporary directory and returns
the path to the file.