mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-27 20:55:12 -05:00
feat: Upgrade to Python 3.12 (#4675)
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import random
|
||||
from collections.abc import Iterable
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
from math import ceil
|
||||
from typing import Any, Generic, TypeVar
|
||||
|
||||
@@ -70,7 +70,7 @@ class RepositoryGeneric(Generic[Schema, Model]):
|
||||
return self._household_id
|
||||
|
||||
def _random_seed(self) -> str:
|
||||
return str(datetime.now(tz=timezone.utc))
|
||||
return str(datetime.now(tz=UTC))
|
||||
|
||||
def _log_exception(self, e: Exception) -> None:
|
||||
self.logger.error(f"Error processing query for Repo model={self.model.__name__} schema={self.schema.__name__}")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime, timezone
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from sqlalchemy import select
|
||||
|
||||
@@ -13,7 +13,7 @@ class RepositoryMeals(HouseholdRepositoryGeneric[ReadPlanEntry, GroupMealPlan]):
|
||||
if not self.household_id:
|
||||
raise Exception("household_id not set")
|
||||
|
||||
today = datetime.now(tz=timezone.utc).date()
|
||||
today = datetime.now(tz=UTC).date()
|
||||
stmt = select(GroupMealPlan).filter(
|
||||
GroupMealPlan.date == today, GroupMealPlan.household_id == self.household_id
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import re as re
|
||||
from collections.abc import Sequence
|
||||
from random import randint
|
||||
from typing import cast
|
||||
from typing import Self, cast
|
||||
from uuid import UUID
|
||||
|
||||
import sqlalchemy as sa
|
||||
@@ -10,7 +10,6 @@ from pydantic import UUID4
|
||||
from slugify import slugify
|
||||
from sqlalchemy import orm
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from typing_extensions import Self
|
||||
|
||||
from mealie.db.models.household.household import Household
|
||||
from mealie.db.models.recipe.category import Category
|
||||
|
||||
Reference in New Issue
Block a user