diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d5049fa7..a09b09fcd 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 + 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..ce38f1598 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,3 +59,9 @@ 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..e7e3f9e5b --- /dev/null +++ b/mypy.ini @@ -0,0 +1,7 @@ +[mypy] +python_version = 3.9 +ignore_missing_imports = True +disallow_untyped_defs = True +check_untyped_defs = True +exclude = ^(venv/|build/|dist/|.*site-packages.*)$ +explicit_package_bases = True