diff --git a/.github/workflows/partial-backend.yml b/.github/workflows/partial-backend.yml index 4f235897bc87..aefd386fabff 100644 --- a/.github/workflows/partial-backend.yml +++ b/.github/workflows/partial-backend.yml @@ -75,7 +75,7 @@ jobs: sudo apt-get update sudo apt-get install libsasl2-dev libldap2-dev libssl-dev poetry install - poetry add "psycopg2-binary==2.8.6" + poetry add "psycopg2-binary==2.9.9" if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' || steps.cache-validate.outputs.cache-hit-success != 'true' - name: Formatting (Black) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a109f865579..aafe1be8e1ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,6 @@ repos: - id: trailing-whitespace exclude: ^tests/data/ - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 24.1.0 hooks: - id: black diff --git a/alembic/versions/2022-02-21-19.56.24_6b0f5f32d602_initial_tables.py b/alembic/versions/2022-02-21-19.56.24_6b0f5f32d602_initial_tables.py index 03cd0918bda8..8ebd1b395c12 100644 --- a/alembic/versions/2022-02-21-19.56.24_6b0f5f32d602_initial_tables.py +++ b/alembic/versions/2022-02-21-19.56.24_6b0f5f32d602_initial_tables.py @@ -1,10 +1,11 @@ """Initial tables Revision ID: 6b0f5f32d602 -Revises: +Revises: Create Date: 2022-02-21 19:56:24.351115 """ + import sqlalchemy as sa from sqlalchemy import engine_from_config diff --git a/alembic/versions/2022-03-23-17.43.34_263dd6707191_convert_quantity_from_integer_to_float.py b/alembic/versions/2022-03-23-17.43.34_263dd6707191_convert_quantity_from_integer_to_float.py index b453ecdff04c..b9de7e23d69f 100644 --- a/alembic/versions/2022-03-23-17.43.34_263dd6707191_convert_quantity_from_integer_to_float.py +++ b/alembic/versions/2022-03-23-17.43.34_263dd6707191_convert_quantity_from_integer_to_float.py @@ -5,6 +5,7 @@ Revises: 6b0f5f32d602 Create Date: 2022-03-23 17:43:34.727829 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2022-03-27-19.30.28_f1a2dbee5fe9_add_original_text_column_to_recipes_.py b/alembic/versions/2022-03-27-19.30.28_f1a2dbee5fe9_add_original_text_column_to_recipes_.py index 62698ded844c..fc62f3517e4d 100644 --- a/alembic/versions/2022-03-27-19.30.28_f1a2dbee5fe9_add_original_text_column_to_recipes_.py +++ b/alembic/versions/2022-03-27-19.30.28_f1a2dbee5fe9_add_original_text_column_to_recipes_.py @@ -5,6 +5,7 @@ Revises: 263dd6707191 Create Date: 2022-03-27 19:30:28.545846 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2022-03-31-19.19.55_59eb59135381_add_tags_to_cookbooks.py b/alembic/versions/2022-03-31-19.19.55_59eb59135381_add_tags_to_cookbooks.py index c0c99246cd49..ed751d9df75e 100644 --- a/alembic/versions/2022-03-31-19.19.55_59eb59135381_add_tags_to_cookbooks.py +++ b/alembic/versions/2022-03-31-19.19.55_59eb59135381_add_tags_to_cookbooks.py @@ -5,6 +5,7 @@ Revises: f1a2dbee5fe9 Create Date: 2022-03-31 19:19:55.428965 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/alembic/versions/2022-04-03-10.48.51_09dfc897ad62_add_require_all_for_cookbook_filters.py b/alembic/versions/2022-04-03-10.48.51_09dfc897ad62_add_require_all_for_cookbook_filters.py index f58414d29b5e..19cd08c855c7 100644 --- a/alembic/versions/2022-04-03-10.48.51_09dfc897ad62_add_require_all_for_cookbook_filters.py +++ b/alembic/versions/2022-04-03-10.48.51_09dfc897ad62_add_require_all_for_cookbook_filters.py @@ -5,6 +5,7 @@ Revises: 59eb59135381 Create Date: 2022-04-03 10:48:51.379968 """ + import sqlalchemy as sa import mealie.db.migration_types # noqa: F401 diff --git a/alembic/versions/2022-06-01-11.12.06_ab0bae02578f_add_use_abbreviation_column_to_.py b/alembic/versions/2022-06-01-11.12.06_ab0bae02578f_add_use_abbreviation_column_to_.py index 3f39ef0ddcba..ed46e40b67e1 100644 --- a/alembic/versions/2022-06-01-11.12.06_ab0bae02578f_add_use_abbreviation_column_to_.py +++ b/alembic/versions/2022-06-01-11.12.06_ab0bae02578f_add_use_abbreviation_column_to_.py @@ -5,6 +5,7 @@ Revises: 09dfc897ad62 Create Date: 2022-06-01 11:12:06.748383 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2022-06-15-21.05.34_f30cf048c228_add_new_webhook_fields.py b/alembic/versions/2022-06-15-21.05.34_f30cf048c228_add_new_webhook_fields.py index 5b1d029a1721..085b9b29c4db 100644 --- a/alembic/versions/2022-06-15-21.05.34_f30cf048c228_add_new_webhook_fields.py +++ b/alembic/versions/2022-06-15-21.05.34_f30cf048c228_add_new_webhook_fields.py @@ -6,6 +6,7 @@ Revises: ab0bae02578f Create Date: 2022-06-15 21:05:34.851857 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2022-08-12-19.05.59_188374910655_add_login_attemps_and_locked_at_field_.py b/alembic/versions/2022-08-12-19.05.59_188374910655_add_login_attemps_and_locked_at_field_.py index 9db5b91b1da8..45fedc026163 100644 --- a/alembic/versions/2022-08-12-19.05.59_188374910655_add_login_attemps_and_locked_at_field_.py +++ b/alembic/versions/2022-08-12-19.05.59_188374910655_add_login_attemps_and_locked_at_field_.py @@ -5,6 +5,7 @@ Revises: f30cf048c228 Create Date: 2022-08-12 19:05:59.776361 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2022-08-13-17.07.07_089bfa50d0ed_add_is_ocr_recipe_column_to_recipes.py b/alembic/versions/2022-08-13-17.07.07_089bfa50d0ed_add_is_ocr_recipe_column_to_recipes.py index 51da2f319d5f..ba1595486e81 100644 --- a/alembic/versions/2022-08-13-17.07.07_089bfa50d0ed_add_is_ocr_recipe_column_to_recipes.py +++ b/alembic/versions/2022-08-13-17.07.07_089bfa50d0ed_add_is_ocr_recipe_column_to_recipes.py @@ -5,6 +5,7 @@ Revises: 188374910655 Create Date: 2022-08-05 17:07:07.389271 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2022-08-29-13.57.40_44e8d670719d_add_extras_to_shopping_lists_list_items_.py b/alembic/versions/2022-08-29-13.57.40_44e8d670719d_add_extras_to_shopping_lists_list_items_.py index 8a5477a8d858..c688c0e603af 100644 --- a/alembic/versions/2022-08-29-13.57.40_44e8d670719d_add_extras_to_shopping_lists_list_items_.py +++ b/alembic/versions/2022-08-29-13.57.40_44e8d670719d_add_extras_to_shopping_lists_list_items_.py @@ -5,6 +5,7 @@ Revises: 089bfa50d0ed Create Date: 2022-08-29 13:57:40.452245 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/alembic/versions/2022-09-27-14.53.14_2ea7a807915c_add_recipe_timeline_events_table.py b/alembic/versions/2022-09-27-14.53.14_2ea7a807915c_add_recipe_timeline_events_table.py index 1228bd06bf06..57edfe315b23 100644 --- a/alembic/versions/2022-09-27-14.53.14_2ea7a807915c_add_recipe_timeline_events_table.py +++ b/alembic/versions/2022-09-27-14.53.14_2ea7a807915c_add_recipe_timeline_events_table.py @@ -5,6 +5,7 @@ Revises: 44e8d670719d Create Date: 2022-09-27 14:53:14.111054 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/alembic/versions/2022-11-03-13.10.24_1923519381ad_renamed_timeline_event_message_and_.py b/alembic/versions/2022-11-03-13.10.24_1923519381ad_renamed_timeline_event_message_and_.py index 761f3d7e7463..e68c5bcf8738 100644 --- a/alembic/versions/2022-11-03-13.10.24_1923519381ad_renamed_timeline_event_message_and_.py +++ b/alembic/versions/2022-11-03-13.10.24_1923519381ad_renamed_timeline_event_message_and_.py @@ -5,6 +5,7 @@ Revises: 2ea7a807915c Create Date: 2022-11-03 13:10:24.811134 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2022-11-22-03.42.45_167eb69066ad_add_recipe_scale_to_shopping_list_item_.py b/alembic/versions/2022-11-22-03.42.45_167eb69066ad_add_recipe_scale_to_shopping_list_item_.py index 42f508cd3673..dc83ca47d501 100644 --- a/alembic/versions/2022-11-22-03.42.45_167eb69066ad_add_recipe_scale_to_shopping_list_item_.py +++ b/alembic/versions/2022-11-22-03.42.45_167eb69066ad_add_recipe_scale_to_shopping_list_item_.py @@ -5,6 +5,7 @@ Revises: 1923519381ad Create Date: 2022-11-22 03:42:45.494567 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2023-01-21-16.54.44_165d943c64ee_add_related_user_to_mealplan.py b/alembic/versions/2023-01-21-16.54.44_165d943c64ee_add_related_user_to_mealplan.py index c9e511b1d337..103039563431 100644 --- a/alembic/versions/2023-01-21-16.54.44_165d943c64ee_add_related_user_to_mealplan.py +++ b/alembic/versions/2023-01-21-16.54.44_165d943c64ee_add_related_user_to_mealplan.py @@ -5,6 +5,7 @@ Revises: 167eb69066ad Create Date: 2023-01-21 16:54:44.368768 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/alembic/versions/2023-02-10-21.18.32_16160bf731a0_add_more_indices_necessary_for_search.py b/alembic/versions/2023-02-10-21.18.32_16160bf731a0_add_more_indices_necessary_for_search.py index 29268c6e3b7d..22536e6a4e30 100644 --- a/alembic/versions/2023-02-10-21.18.32_16160bf731a0_add_more_indices_necessary_for_search.py +++ b/alembic/versions/2023-02-10-21.18.32_16160bf731a0_add_more_indices_necessary_for_search.py @@ -5,6 +5,7 @@ Revises: ff5f73b01a7a Create Date: 2023-02-10 21:18:32.405130 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/alembic/versions/2023-02-14-20.45.41_5ab195a474eb_add_normalized_search_properties.py b/alembic/versions/2023-02-14-20.45.41_5ab195a474eb_add_normalized_search_properties.py index 773aaf5c1212..ea638febd56b 100644 --- a/alembic/versions/2023-02-14-20.45.41_5ab195a474eb_add_normalized_search_properties.py +++ b/alembic/versions/2023-02-14-20.45.41_5ab195a474eb_add_normalized_search_properties.py @@ -5,6 +5,7 @@ Revises: 16160bf731a0 Create Date: 2023-02-14 20:45:41.102571 """ + import sqlalchemy as sa from sqlalchemy import orm, select from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column diff --git a/alembic/versions/2023-02-21-22.03.19_b04a08da2108_added_shopping_list_label_settings.py b/alembic/versions/2023-02-21-22.03.19_b04a08da2108_added_shopping_list_label_settings.py index edca93c2b6a4..a230433292a7 100644 --- a/alembic/versions/2023-02-21-22.03.19_b04a08da2108_added_shopping_list_label_settings.py +++ b/alembic/versions/2023-02-21-22.03.19_b04a08da2108_added_shopping_list_label_settings.py @@ -5,6 +5,7 @@ Revises: 5ab195a474eb Create Date: 2023-21-02 22:03:19.837244 """ + from uuid import uuid4 import sqlalchemy as sa diff --git a/alembic/versions/2023-02-22-21.45.52_38514b39a824_add_auth_method_to_user_table.py b/alembic/versions/2023-02-22-21.45.52_38514b39a824_add_auth_method_to_user_table.py index 95d92086539c..83103cf27bf9 100644 --- a/alembic/versions/2023-02-22-21.45.52_38514b39a824_add_auth_method_to_user_table.py +++ b/alembic/versions/2023-02-22-21.45.52_38514b39a824_add_auth_method_to_user_table.py @@ -5,6 +5,7 @@ Revises: b04a08da2108 Create Date: 2023-02-22 21:45:52.900964 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/alembic/versions/2023-04-13-06.47.04_b3dbb554ba53_postgres_fuzzy_search.py b/alembic/versions/2023-04-13-06.47.04_b3dbb554ba53_postgres_fuzzy_search.py index 159087bc86e8..3f4a2543051a 100644 --- a/alembic/versions/2023-04-13-06.47.04_b3dbb554ba53_postgres_fuzzy_search.py +++ b/alembic/versions/2023-04-13-06.47.04_b3dbb554ba53_postgres_fuzzy_search.py @@ -5,6 +5,7 @@ Revises: 38514b39a824 Create Date: 2023-04-13 06:47:04.617131 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/alembic/versions/2023-08-06-21.00.34_04ac51cbe9a4_added_group_slug.py b/alembic/versions/2023-08-06-21.00.34_04ac51cbe9a4_added_group_slug.py index be341fde57f4..50748f94276d 100644 --- a/alembic/versions/2023-08-06-21.00.34_04ac51cbe9a4_added_group_slug.py +++ b/alembic/versions/2023-08-06-21.00.34_04ac51cbe9a4_added_group_slug.py @@ -5,6 +5,7 @@ Revises: b3dbb554ba53 Create Date: 2023-08-06 21:00:34.582905 """ + import sqlalchemy as sa from slugify import slugify from sqlalchemy.orm import Session diff --git a/alembic/versions/2023-08-14-19.30.49_1825b5225403_added_recipe_note_to_shopping_list_.py b/alembic/versions/2023-08-14-19.30.49_1825b5225403_added_recipe_note_to_shopping_list_.py index b6a6489016b3..a095a8a5b8b5 100644 --- a/alembic/versions/2023-08-14-19.30.49_1825b5225403_added_recipe_note_to_shopping_list_.py +++ b/alembic/versions/2023-08-14-19.30.49_1825b5225403_added_recipe_note_to_shopping_list_.py @@ -5,6 +5,7 @@ Revises: 04ac51cbe9a4 Create Date: 2023-08-14 19:30:49.103185 """ + import sqlalchemy as sa from alembic import op diff --git a/alembic/versions/2023-08-15-16.25.07_bcfdad6b7355_remove_tool_name_and_slug_unique_.py b/alembic/versions/2023-08-15-16.25.07_bcfdad6b7355_remove_tool_name_and_slug_unique_.py index c61e0b989436..822202d69596 100644 --- a/alembic/versions/2023-08-15-16.25.07_bcfdad6b7355_remove_tool_name_and_slug_unique_.py +++ b/alembic/versions/2023-08-15-16.25.07_bcfdad6b7355_remove_tool_name_and_slug_unique_.py @@ -5,6 +5,7 @@ Revises: 1825b5225403 Create Date: 2023-08-15 16:25:07.058929 """ + from alembic import op # revision identifiers, used by Alembic. diff --git a/alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py b/alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py index f77fe6fbc21e..1cbf60a7ec88 100644 --- a/alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py +++ b/alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py @@ -5,6 +5,7 @@ Revises: bcfdad6b7355 Create Date: 2023-09-01 14:55:42.166766 """ + import sqlalchemy as sa from sqlalchemy import orm, select diff --git a/alembic/versions/2023-10-04-14.29.26_dded3119c1fe_added_unique_constraints.py b/alembic/versions/2023-10-04-14.29.26_dded3119c1fe_added_unique_constraints.py index 67c648028d75..3a3c941ce6b1 100644 --- a/alembic/versions/2023-10-04-14.29.26_dded3119c1fe_added_unique_constraints.py +++ b/alembic/versions/2023-10-04-14.29.26_dded3119c1fe_added_unique_constraints.py @@ -5,6 +5,7 @@ Revises: 0341b154f79a Create Date: 2023-10-04 14:29:26.688065 """ + from collections import defaultdict from dataclasses import dataclass from typing import Any diff --git a/alembic/versions/2023-10-19-19.22.55_ba1e4a6cfe99_added_plural_names_and_alias_tables_for_.py b/alembic/versions/2023-10-19-19.22.55_ba1e4a6cfe99_added_plural_names_and_alias_tables_for_.py index 23952dc704a0..d7d3762f45b2 100644 --- a/alembic/versions/2023-10-19-19.22.55_ba1e4a6cfe99_added_plural_names_and_alias_tables_for_.py +++ b/alembic/versions/2023-10-19-19.22.55_ba1e4a6cfe99_added_plural_names_and_alias_tables_for_.py @@ -5,6 +5,7 @@ Revises: dded3119c1fe Create Date: 2023-10-19 19:22:55.369319 """ + import sqlalchemy as sa import mealie.db.migration_types diff --git a/mealie/core/security/hasher.py b/mealie/core/security/hasher.py index 638a36a463e4..8b702482ae23 100644 --- a/mealie/core/security/hasher.py +++ b/mealie/core/security/hasher.py @@ -7,11 +7,9 @@ from mealie.core.config import get_app_settings class Hasher(Protocol): - def hash(self, password: str) -> str: - ... + def hash(self, password: str) -> str: ... - def verify(self, password: str, hashed: str) -> bool: - ... + def verify(self, password: str, hashed: str) -> bool: ... class FakeHasher: diff --git a/mealie/core/security/security.py b/mealie/core/security/security.py index 7cd8dd42c3a2..c04bde22b341 100644 --- a/mealie/core/security/security.py +++ b/mealie/core/security/security.py @@ -18,8 +18,7 @@ ALGORITHM = "HS256" logger = root_logger.get_logger("security") -class UserLockedOut(Exception): - ... +class UserLockedOut(Exception): ... def create_access_token(data: dict, expires_delta: timedelta | None = None) -> str: diff --git a/mealie/core/settings/db_providers.py b/mealie/core/settings/db_providers.py index f8f0e40e2e8d..f3bbc8714388 100644 --- a/mealie/core/settings/db_providers.py +++ b/mealie/core/settings/db_providers.py @@ -7,13 +7,11 @@ from pydantic import BaseModel, BaseSettings, PostgresDsn class AbstractDBProvider(ABC): @property @abstractmethod - def db_url(self) -> str: - ... + def db_url(self) -> str: ... @property @abstractmethod - def db_url_public(self) -> str: - ... + def db_url_public(self) -> str: ... class SQLiteProvider(AbstractDBProvider, BaseModel): diff --git a/mealie/db/models/group/webhooks.py b/mealie/db/models/group/webhooks.py index aac97fc0f561..e05e8bf837d1 100644 --- a/mealie/db/models/group/webhooks.py +++ b/mealie/db/models/group/webhooks.py @@ -31,5 +31,4 @@ class GroupWebhooksModel(SqlAlchemyBase, BaseMixins): time: Mapped[str | None] = mapped_column(String, default="00:00") @auto_init() - def __init__(self, **_) -> None: - ... + def __init__(self, **_) -> None: ... diff --git a/mealie/pkgs/img/__init__.py b/mealie/pkgs/img/__init__.py index 997641dad965..1182bd4a255d 100644 --- a/mealie/pkgs/img/__init__.py +++ b/mealie/pkgs/img/__init__.py @@ -3,5 +3,4 @@ The img package is a collection of utilities for working with images. While it o within the img package should not be tightly coupled to Mealie. """ - from .minify import * diff --git a/mealie/pkgs/img/minify.py b/mealie/pkgs/img/minify.py index 23c3eb065555..b667a2f2a113 100644 --- a/mealie/pkgs/img/minify.py +++ b/mealie/pkgs/img/minify.py @@ -46,8 +46,7 @@ class ABCMinifier(ABC): ) @abstractmethod - def minify(self, image: Path, force=True): - ... + def minify(self, image: Path, force=True): ... def purge(self, image: Path): if not self._purge: diff --git a/mealie/repos/seed/_abstract_seeder.py b/mealie/repos/seed/_abstract_seeder.py index 6f06d37143af..2e7f837f699c 100644 --- a/mealie/repos/seed/_abstract_seeder.py +++ b/mealie/repos/seed/_abstract_seeder.py @@ -25,5 +25,4 @@ class AbstractSeeder(ABC): self.resources = Path(__file__).parent / "resources" @abstractmethod - def seed(self, locale: str | None = None) -> None: - ... + def seed(self, locale: str | None = None) -> None: ... diff --git a/mealie/routes/_base/controller.py b/mealie/routes/_base/controller.py index 4f6cf9e736e3..f832c13b7992 100644 --- a/mealie/routes/_base/controller.py +++ b/mealie/routes/_base/controller.py @@ -3,6 +3,7 @@ This file contains code taken from fastapi-utils project. The code is licensed u See their repository for details -> https://github.com/dmontagu/fastapi-utils """ + import inspect from collections.abc import Callable from typing import Any, TypeVar, cast, get_type_hints diff --git a/mealie/services/backups_v2/backup_v2.py b/mealie/services/backups_v2/backup_v2.py index 0123ef90bcc1..20beea9f9462 100644 --- a/mealie/services/backups_v2/backup_v2.py +++ b/mealie/services/backups_v2/backup_v2.py @@ -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): diff --git a/mealie/services/email/email_senders.py b/mealie/services/email/email_senders.py index ecb840c6f9c5..56015fdadca5 100644 --- a/mealie/services/email/email_senders.py +++ b/mealie/services/email/email_senders.py @@ -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): diff --git a/mealie/services/event_bus_service/event_bus_listeners.py b/mealie/services/event_bus_service/event_bus_listeners.py index f618cebd9e2a..ef91378153eb 100644 --- a/mealie/services/event_bus_service/event_bus_listeners.py +++ b/mealie/services/event_bus_service/event_bus_listeners.py @@ -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 ] diff --git a/mealie/services/event_bus_service/publisher.py b/mealie/services/event_bus_service/publisher.py index 81c3c4b5d5be..7cd64fcb9df5 100644 --- a/mealie/services/event_bus_service/publisher.py +++ b/mealie/services/event_bus_service/publisher.py @@ -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: diff --git a/mealie/services/exporter/_abc_exporter.py b/mealie/services/exporter/_abc_exporter.py index 3c3cd65cab1c..16fe1fbc8d9b 100644 --- a/mealie/services/exporter/_abc_exporter.py +++ b/mealie/services/exporter/_abc_exporter.py @@ -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 diff --git a/mealie/services/parser_services/ingredient_parser.py b/mealie/services/parser_services/ingredient_parser.py index 3748296b60db..b487c4c85e3c 100644 --- a/mealie/services/parser_services/ingredient_parser.py +++ b/mealie/services/parser_services/ingredient_parser.py @@ -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: diff --git a/mealie/services/scraper/scraper_strategies.py b/mealie/services/scraper/scraper_strategies.py index b9aa89784152..ed35028955bc 100644 --- a/mealie/services/scraper/scraper_strategies.py +++ b/mealie/services/scraper/scraper_strategies.py @@ -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]: diff --git a/poetry.lock b/poetry.lock index 1d556ff97653..001fe61ef5ef 100644 --- a/poetry.lock +++ b/poetry.lock @@ -186,33 +186,33 @@ lxml = ["lxml"] [[package]] name = "black" -version = "23.12.1" +version = "24.1.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" files = [ - {file = "black-23.12.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2"}, - {file = "black-23.12.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba"}, - {file = "black-23.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a920b569dc6b3472513ba6ddea21f440d4b4c699494d2e972a1753cdc25df7b0"}, - {file = "black-23.12.1-cp310-cp310-win_amd64.whl", hash = "sha256:3fa4be75ef2a6b96ea8d92b1587dd8cb3a35c7e3d51f0738ced0781c3aa3a5a3"}, - {file = "black-23.12.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba"}, - {file = "black-23.12.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b"}, - {file = "black-23.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59"}, - {file = "black-23.12.1-cp311-cp311-win_amd64.whl", hash = "sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50"}, - {file = "black-23.12.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e"}, - {file = "black-23.12.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec"}, - {file = "black-23.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e"}, - {file = "black-23.12.1-cp312-cp312-win_amd64.whl", hash = "sha256:ae76c22bde5cbb6bfd211ec343ded2163bba7883c7bc77f6b756a1049436fbb9"}, - {file = "black-23.12.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1fa88a0f74e50e4487477bc0bb900c6781dbddfdfa32691e780bf854c3b4a47f"}, - {file = "black-23.12.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a4d6a9668e45ad99d2f8ec70d5c8c04ef4f32f648ef39048d010b0689832ec6d"}, - {file = "black-23.12.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b18fb2ae6c4bb63eebe5be6bd869ba2f14fd0259bda7d18a46b764d8fb86298a"}, - {file = "black-23.12.1-cp38-cp38-win_amd64.whl", hash = "sha256:c04b6d9d20e9c13f43eee8ea87d44156b8505ca8a3c878773f68b4e4812a421e"}, - {file = "black-23.12.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3e1b38b3135fd4c025c28c55ddfc236b05af657828a8a6abe5deec419a0b7055"}, - {file = "black-23.12.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4f0031eaa7b921db76decd73636ef3a12c942ed367d8c3841a0739412b260a54"}, - {file = "black-23.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97e56155c6b737854e60a9ab1c598ff2533d57e7506d97af5481141671abf3ea"}, - {file = "black-23.12.1-cp39-cp39-win_amd64.whl", hash = "sha256:dd15245c8b68fe2b6bd0f32c1556509d11bb33aec9b5d0866dd8e2ed3dba09c2"}, - {file = "black-23.12.1-py3-none-any.whl", hash = "sha256:78baad24af0f033958cad29731e27363183e140962595def56423e626f4bee3e"}, - {file = "black-23.12.1.tar.gz", hash = "sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5"}, + {file = "black-24.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:94d5280d020dadfafc75d7cae899609ed38653d3f5e82e7ce58f75e76387ed3d"}, + {file = "black-24.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:aaf9aa85aaaa466bf969e7dd259547f4481b712fe7ee14befeecc152c403ee05"}, + {file = "black-24.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec489cae76eac3f7573629955573c3a0e913641cafb9e3bfc87d8ce155ebdb29"}, + {file = "black-24.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:a5a0100b4bdb3744dd68412c3789f472d822dc058bb3857743342f8d7f93a5a7"}, + {file = "black-24.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6cc5a6ba3e671cfea95a40030b16a98ee7dc2e22b6427a6f3389567ecf1b5262"}, + {file = "black-24.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e0e367759062dcabcd9a426d12450c6d61faf1704a352a49055a04c9f9ce8f5a"}, + {file = "black-24.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be305563ff4a2dea813f699daaffac60b977935f3264f66922b1936a5e492ee4"}, + {file = "black-24.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:6a8977774929b5db90442729f131221e58cc5d8208023c6af9110f26f75b6b20"}, + {file = "black-24.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d74d4d0da276fbe3b95aa1f404182562c28a04402e4ece60cf373d0b902f33a0"}, + {file = "black-24.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39addf23f7070dbc0b5518cdb2018468ac249d7412a669b50ccca18427dba1f3"}, + {file = "black-24.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:827a7c0da520dd2f8e6d7d3595f4591aa62ccccce95b16c0e94bb4066374c4c2"}, + {file = "black-24.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:0cd59d01bf3306ff7e3076dd7f4435fcd2fafe5506a6111cae1138fc7de52382"}, + {file = "black-24.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bf8dd261ee82df1abfb591f97e174345ab7375a55019cc93ad38993b9ff5c6ad"}, + {file = "black-24.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:82d9452aeabd51d1c8f0d52d4d18e82b9f010ecb30fd55867b5ff95904f427ff"}, + {file = "black-24.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9aede09f72b2a466e673ee9fca96e4bccc36f463cac28a35ce741f0fd13aea8b"}, + {file = "black-24.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:780f13d03066a7daf1707ec723fdb36bd698ffa29d95a2e7ef33a8dd8fe43b5c"}, + {file = "black-24.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a15670c650668399c4b5eae32e222728185961d6ef6b568f62c1681d57b381ba"}, + {file = "black-24.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1e0fa70b8464055069864a4733901b31cbdbe1273f63a24d2fa9d726723d45ac"}, + {file = "black-24.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fa8d9aaa22d846f8c0f7f07391148e5e346562e9b215794f9101a8339d8b6d8"}, + {file = "black-24.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:f0dfbfbacfbf9cd1fac7a5ddd3e72510ffa93e841a69fcf4a6358feab1685382"}, + {file = "black-24.1.0-py3-none-any.whl", hash = "sha256:5134a6f6b683aa0a5592e3fd61dd3519d8acd953d93e2b8b76f9981245b65594"}, + {file = "black-24.1.0.tar.gz", hash = "sha256:30fbf768cd4f4576598b1db0202413fafea9a227ef808d1a12230c643cefe9fc"}, ] [package.dependencies] @@ -1574,7 +1574,7 @@ virtualenv = ">=20.10.0" name = "psycopg2-binary" version = "2.9.9" description = "psycopg2 - Python-PostgreSQL Database Adapter" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "psycopg2-binary-2.9.9.tar.gz", hash = "sha256:7f01846810177d829c7692f1f5ada8096762d9172af1b1a28d4ab5b77c923c1c"}, @@ -2931,4 +2931,4 @@ pgsql = ["psycopg2-binary"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "ace532ad7192dc6ce6ff449928f8eb89d0d2814ab07b5e09e8a06dbf692cb125" +content-hash = "b01f7f65f250a3ff09b0a053ae8991210ec2071ee388cba922ad58149e60ede1" diff --git a/pyproject.toml b/pyproject.toml index b90b5a0f3b63..7f28186fca8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ html2text = "^2020.1.16" psycopg2-binary = { version = "^2.9.1" } [tool.poetry.group.dev.dependencies] -black = "^23.7.0" +black = "^24.0.0" coverage = "^7.0" coveragepy-lcov = "^0.1.1" mkdocs-material = "^9.0.0" diff --git a/tests/multitenant_tests/case_abc.py b/tests/multitenant_tests/case_abc.py index ac6c019214b0..7dd36ac54a29 100644 --- a/tests/multitenant_tests/case_abc.py +++ b/tests/multitenant_tests/case_abc.py @@ -13,20 +13,16 @@ class ABCMultiTenantTestCase(ABC): self.items: list = [] @abstractmethod - def seed_action(self, group_id: str) -> set[int] | set[str]: - ... + def seed_action(self, group_id: str) -> set[int] | set[str]: ... @abstractmethod - def seed_multi(self, group1_id: str, group2_id: str) -> tuple[set[str], set[str]]: - ... + def seed_multi(self, group1_id: str, group2_id: str) -> tuple[set[str], set[str]]: ... @abstractmethod - def get_all(self, token: str) -> Response: - ... + def get_all(self, token: str) -> Response: ... @abstractmethod - def cleanup(self) -> None: - ... + def cleanup(self) -> None: ... def __enter__(self): pass