From d9fd48a50ec200828f484daf4e8d934da34e687b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Doma=C5=84ski?= Date: Mon, 20 May 2024 13:32:47 +0200 Subject: [PATCH] [mypy] configure for usage, need to fix all errors now --- Makefile | 8 ++++---- mypy.ini | 12 ++++++++++++ requirements_local.txt | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 mypy.ini diff --git a/Makefile b/Makefile index f3f955f..fcfc10e 100644 --- a/Makefile +++ b/Makefile @@ -14,15 +14,15 @@ push: docker push registry.domandoman.xyz/fooder/api black: - black fooder + python -m black fooder .PHONY: mypy mypy: - mypy fooder + python -m mypy fooder .PHONY: flake flake: - flake8 fooder + python -m flake8 fooder .PHONY: lint lint: black mypy flake @@ -34,7 +34,7 @@ version: .PHONY: create-venv create-venv: python3 -m venv .venv --prompt="fooderapi-venv" --system-site-packages - bash -c "source .venv/bin/activate && pip install -r requirements_local.txt" + bash -c "source .venv/bin/activate && pip install -r requirements_local.txt && (echo y | mypy --install-types)" .PHONY: test test: diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..8e19889 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,12 @@ + +[mypy] +plugins = sqlalchemy.ext.mypy.plugin,pydantic.mypy + +exclude = .*/test/.* + +pretty = True + +platform = linux + +warn_unused_configs = True +warn_unused_ignores = True diff --git a/requirements_local.txt b/requirements_local.txt index 1935134..412570b 100644 --- a/requirements_local.txt +++ b/requirements_local.txt @@ -13,3 +13,5 @@ flake8 flake8-bugbear httpx aiosqlite +mypy +types-requests