From aaac7c7034f51a3b45b6fa86f2531ba4d3d1b242 Mon Sep 17 00:00:00 2001 From: Tosinibikunle Date: Wed, 6 Aug 2025 15:13:54 +0100 Subject: [PATCH 1/5] Fix: Add missing newline to .pre-commit-config.yaml --- .github/workflows/test.yml | 5 +++++ .pre-commit-config.yaml | 5 +++++ mypy.ini | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 mypy.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d5049fa7..30ced8748 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,6 +54,11 @@ jobs: - name: Tox tests run: | tox -v + - name: Run mypy + run: | + pip install mypy==1.17.1 + mypy rest_framework_simplejwt + env: DJANGO: ${{ matrix.django-version }} DRF: ${{ matrix.drf-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6cda928b4..9900c6eb0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,3 +59,8 @@ repos: - id: rst-linter files: >- ^[^/]+[.]rst$ +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.17.1 + hooks: + - id: mypy + args: ["rest_framework_simplejwt"] diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 000000000..a98a6a168 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,5 @@ +[mypy] +python_version >= 3.9 +ignore_missing_imports = True +disallow_untyped_defs = True +check_untyped_defs = True From 76e89e4a4a22f46af9d6cf8bacf4b65d43950ed3 Mon Sep 17 00:00:00 2001 From: Tosinibikunle Date: Wed, 6 Aug 2025 15:25:46 +0100 Subject: [PATCH 2/5] mypy.ini modified --- mypy.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index a98a6a168..cc167ce36 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,6 @@ [mypy] -python_version >= 3.9 +python_version = 3.9 ignore_missing_imports = True disallow_untyped_defs = True check_untyped_defs = True +ignore_errors = True From f4f79fee44abd587d9c75270adfe258bce3acbe9 Mon Sep 17 00:00:00 2001 From: Tosinibikunle Date: Wed, 6 Aug 2025 15:30:07 +0100 Subject: [PATCH 3/5] fixing pre-commit configuration --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9900c6eb0..ce38f1598 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,3 +64,4 @@ repos: hooks: - id: mypy args: ["rest_framework_simplejwt"] + From 54d8370ef870ffbdada01ae362299a0b3904bdd9 Mon Sep 17 00:00:00 2001 From: Tosinibikunle Date: Thu, 7 Aug 2025 20:50:23 +0100 Subject: [PATCH 4/5] Error resolution for mypy configuration --- .github/workflows/test.yml | 2 +- mypy.ini | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30ced8748..a09b09fcd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: tox -v - name: Run mypy run: | - pip install mypy==1.17.1 + pip install mypy mypy rest_framework_simplejwt env: diff --git a/mypy.ini b/mypy.ini index cc167ce36..f5ceac67e 100644 --- a/mypy.ini +++ b/mypy.ini @@ -4,3 +4,10 @@ ignore_missing_imports = True disallow_untyped_defs = True check_untyped_defs = True ignore_errors = True +exclude = (?x)( + ^\.venv/.*$ | + ^env/.*$ | + ^build/.*$ | + ^dist/.*$ | + ^.*site-packages.*$ +) From 97391191c6cfe59fd27a278d008598232079da49 Mon Sep 17 00:00:00 2001 From: Tosinibikunle Date: Thu, 7 Aug 2025 21:20:48 +0100 Subject: [PATCH 5/5] explicit packages mod --- mypy.ini | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mypy.ini b/mypy.ini index f5ceac67e..e7e3f9e5b 100644 --- a/mypy.ini +++ b/mypy.ini @@ -3,11 +3,5 @@ python_version = 3.9 ignore_missing_imports = True disallow_untyped_defs = True check_untyped_defs = True -ignore_errors = True -exclude = (?x)( - ^\.venv/.*$ | - ^env/.*$ | - ^build/.*$ | - ^dist/.*$ | - ^.*site-packages.*$ -) +exclude = ^(venv/|build/|dist/|.*site-packages.*)$ +explicit_package_bases = True