From 1c51f5c98fe06a615991cf30e76d64df88d858cb Mon Sep 17 00:00:00 2001 From: Tom Kazimiers Date: Thu, 5 Dec 2024 13:27:05 +0100 Subject: [PATCH] CI: Re-add django stubs --- .github/workflows/ci.yaml | 2 ++ django/requirements-types.txt | 2 +- setup.cfg | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3b14987ebd..0eeee9a9db 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,8 @@ jobs: pip install "$(grep -E '^mypy' django/requirements-test.txt)" pip install -r django/requirements-types.txt name: Install lint tools + - name: Set python env + run: echo "PYTHONPATH=$pythonLocation:$GITHUB_WORKSPACE/django/projects/" >> $GITHUB_ENV - run: flake8 --statistics --count django - run: mypy django/ diff --git a/django/requirements-types.txt b/django/requirements-types.txt index 6a499eb4d9..1dec9daeff 100644 --- a/django/requirements-types.txt +++ b/django/requirements-types.txt @@ -1,4 +1,4 @@ -#django-stubs==5.1.1 +django-stubs==5.1.1 types-python-dateutil==2.9.0.20241003 types-docutils==0.21.0.20241128 types-requests==2.32.0.20241016 diff --git a/setup.cfg b/setup.cfg index b775138864..4e9adc0263 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,13 @@ [mypy] check_untyped_defs = True ignore_missing_imports = True +disable_error_code = import-untyped warn_incomplete_stub = False +plugins = mypy_django_plugin.main + +[mypy.plugins.django-stubs] +django_settings_module = 'mysite.settings' +strict_settings = False [mypy-applications.catmaid.migrations.*] ignore_errors = True