diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14b6cc012..4d8f1a1cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,6 +95,29 @@ jobs: - name: Run stubtest run: bash ./scripts/stubtest.sh + run-pyright: + timeout-minutes: 10 + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.12'] # TODO: enable on other versions + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install -U pip setuptools wheel + SETUPTOOLS_ENABLE_FEATURES=legacy-editable pip install -r ./requirements.txt + - name: Run pyright + uses: jakebailey/pyright-action@v2 + with: + pylance-version: latest-release + continue-on-error: true # TODO: remove this part + matrix-test: timeout-minutes: 10 runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index 99c90fdd2..44508e2f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,26 @@ include = '\.pyi?$' [tool.codespell] ignore-words-list = "aadd,acount,nam,asend" +[tool.pyright] +include = [ + "django-stubs", + "ext/django_stubs_ext", + "mypy_django_plugin", + "scripts", + "tests", +] +exclude = [ + ".github", + ".mypy_cache", + "build", +] +stubPath = "." +typeCheckingMode = "strict" + +pythonVersion = "3.8" +pythonPlatform = "All" + + [tool.ruff] # Adds to default excludes: https://ruff.rs/docs/settings/#exclude extend-exclude = [