mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-19 05:09:40 +02:00
* add basic pre-commit file * add flake8 * add isort * add pep585-upgrade (typing upgrades) * use namespace for import * add mypy * update ci for backend * flake8 scope * fix version format * update makefile * disable strict option (temporary) * fix mypy issues * upgrade type hints (pre-commit) * add vscode typing check * add types to dev deps * remote container draft * update setup script * update compose version * run setup on create * dev containers update * remove unused pages * update setup tips * expose ports * Update pre-commit to include flask8-print (#1053) * Add in flake8-print to pre-commit * pin version of flake8-print * formatting * update getting strated docs * add mypy to pre-commit * purge .mypy_cache on clean * drop mypy Co-authored-by: zackbcom <zackbcom@users.noreply.github.com>
15 lines
454 B
Python
15 lines
454 B
Python
from collections.abc import Callable
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class MigrationAlias(BaseModel):
|
|
"""A datatype used by MigrationBase to pre-process a recipe dictionary to rewrite
|
|
the alias key in the dictionary, if it exists, to the key. If set a `func` attribute
|
|
will be called on the value before assigning the value to the new key
|
|
"""
|
|
|
|
key: str
|
|
alias: str
|
|
func: Optional[Callable] = None
|