fix: Upgrade Black (#3057)

* bump black

* bump black on precommit

* run black

* fix backend test runner
This commit is contained in:
Michael Genson
2024-01-27 15:11:54 -06:00
committed by GitHub
parent 0800a8d00a
commit a5ef18669b
45 changed files with 81 additions and 73 deletions

View File

@@ -9,8 +9,7 @@ from mealie.services.backups_v2.alchemy_exporter import AlchemyExporter
from mealie.services.backups_v2.backup_file import BackupFile
class BackupSchemaMismatch(Exception):
...
class BackupSchemaMismatch(Exception): ...
class BackupV2(BaseService):

View File

@@ -73,8 +73,7 @@ class Message:
class ABCEmailSender(ABC):
@abstractmethod
def send(self, email_to: str, subject: str, html: str) -> bool:
...
def send(self, email_to: str, subject: str, html: str) -> bool: ...
class DefaultEmailSender(ABCEmailSender, BaseService):

View File

@@ -100,9 +100,12 @@ class AppriseEventListener(EventListenerBase):
return [
# We use query params to add custom key: value pairs to the Apprise payload by prepending the key with ":".
AppriseEventListener.merge_query_parameters(url, {f":{k}": v for k, v in params.items()})
# only certain endpoints support the custom key: value pairs, so we only apply them to those endpoints
if AppriseEventListener.is_custom_url(url) else url
(
AppriseEventListener.merge_query_parameters(url, {f":{k}": v for k, v in params.items()})
# only certain endpoints support the custom key: value pairs, so we only apply them to those endpoints
if AppriseEventListener.is_custom_url(url)
else url
)
for url in urls
]

View File

@@ -8,8 +8,7 @@ from mealie.services.event_bus_service.event_types import Event
class PublisherLike(Protocol):
def publish(self, event: Event, notification_urls: list[str]):
...
def publish(self, event: Event, notification_urls: list[str]): ...
class ApprisePublisher:

View File

@@ -37,12 +37,10 @@ class ABCExporter(BaseService):
super().__init__()
@abstractproperty
def destination_dir(self) -> str:
...
def destination_dir(self) -> str: ...
@abstractmethod
def items(self) -> Iterator[ExportedItem]:
...
def items(self) -> Iterator[ExportedItem]: ...
def _post_export_hook(self, _: BaseModel) -> None:
pass

View File

@@ -106,12 +106,10 @@ class ABCIngredientParser(ABC):
return 70
@abstractmethod
def parse_one(self, ingredient_string: str) -> ParsedIngredient:
...
def parse_one(self, ingredient_string: str) -> ParsedIngredient: ...
@abstractmethod
def parse(self, ingredients: list[str]) -> list[ParsedIngredient]:
...
def parse(self, ingredients: list[str]) -> list[ParsedIngredient]: ...
@classmethod
def find_match(cls, match_value: str, *, store_map: dict[str, T], fuzzy_match_threshold: int = 0) -> T | None:

View File

@@ -82,8 +82,7 @@ class ABCScraperStrategy(ABC):
self.url = url
@abstractmethod
async def get_html(self, url: str) -> str:
...
async def get_html(self, url: str) -> str: ...
@abstractmethod
async def parse(self) -> tuple[Recipe, ScrapedExtras] | tuple[None, None]: