Skip to content

Commit

Permalink
Fix django-stubs / mypy config
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatz committed Nov 12, 2024
1 parent cfb322d commit 0c75b1d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
13 changes: 13 additions & 0 deletions django_utils_lib/stubs/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Warning: This is a stub `settings.py` file, to satisfy the django-stubs mypy
# plugin


INSTALLED_APPS = [
# Django internals
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
]
7 changes: 6 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ warn_unused_configs = True
warn_incomplete_stub = True

# == Plugins ==
plugins = pydantic.mypy
plugins =
pydantic.mypy,
mypy_django_plugin.main

[mypy.plugins.django-stubs]
django_settings_module = "django_utils_lib.stubs.settings"
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pytest-django = "^4.9.0"
pytest-playwright = "^0.5.2"
filelock = "^3.16.0"
debugpy = "^1.8.5"
django = "*"

[tool.ruff]
line-length = 120
Expand Down

0 comments on commit 0c75b1d

Please sign in to comment.