From 92ef295cdead5cf5332541b64667fdbffd7d11a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Voron?= Date: Fri, 18 Feb 2022 11:10:10 +0100 Subject: [PATCH] Add typecheck to build steps --- .github/workflows/build.yml | 9 ++++++--- Makefile | 3 +++ pyproject.toml | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b0ced66..f63d242f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,9 +21,12 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.dev.txt - name: Check codestyle - run: make format-check - - name: Lint - run: make lint + run: | + make format-check + make lint + - name: Typecheck + run: | + make typecheck - name: Test with pytest env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index 57297ab0..52da5ad1 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ format-check: isort-src-check isort-docs-check isort-examples-check lint: flake8 ./fastapi_users ./tests +typecheck: + mypy fastapi_users/ + test: pytest --cov=fastapi_users/ --cov-report=term-missing --cov-fail-under=100 diff --git a/pyproject.toml b/pyproject.toml index f858ae67..d63cd585 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,22 @@ ignore_missing_imports = true module = "passlib.*" ignore_missing_imports = true +[[tool.mypy.overrides]] +module = "fastapi_users_db_mongodb.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "fastapi_users_db_sqlalchemy.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "fastapi_users_db_tortoise.*" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "fastapi_users_db_ormar.*" +ignore_missing_imports = true + [tool.pytest.ini_options] asyncio_mode = "auto" addopts = "--ignore=test_build.py"