Skip to content

Commit

Permalink
Add mypy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gbip committed Jan 15, 2025
1 parent bf2c158 commit 382a2b2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ Run a live documentation server :
sphinx-autobuild docs docs/_build/html
```

## Running static type checking (mypy)

First install the dev dependencies :

```
pip install -r requirements.txt -r requirements-dev.txt
```

Then run mypy :

```
mypy django_pyoidc
```

## Running Tests

Check database settings in `tests/test_settings.py`, target a real PostgreSQL Host (You need a PostgreSQL version 12 or greater), for e2e tests check the `tests/e2e/settings.py` file.
Expand Down
10 changes: 10 additions & 0 deletions mypy_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import Any

DJANGO_PYOIDC: dict[str, dict[str, Any]] = {}

INSTALLED_APPS = [
"django.contrib.contenttypes",
"django.contrib.auth",
"django.contrib.sessions",
"django_pyoidc",
]
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,15 @@ build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.in"] }


[tool.mypy]
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
no_implicit_optional = true
warn_unused_ignores = true
check_untyped_defs = true
show_error_codes = true

[tool.django-stubs]
django_settings_module = "mypy_settings"
strict_settings = false

0 comments on commit 382a2b2

Please sign in to comment.