Fix mypy for django-configurations

still have a lot of bad typing, but at least it runs again
This commit is contained in:
Adam Goldsmith 2024-05-03 00:12:47 -04:00
parent a2c0707263
commit 9658366d72
2 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,12 @@
# https://github.com/typeddjango/django-stubs/pull/180#issuecomment-820062352
import os
from configurations import importer
from mypy_django_plugin import main
def plugin(version):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cmsmanage.settings")
os.environ.setdefault("DJANGO_CONFIGURATION", "Dev")
importer.install()
return main.plugin(version)

View File

@ -90,13 +90,14 @@ indent_size = 2
[tool.mypy] [tool.mypy]
plugins = [ plugins = [
"./cmsmanage/mypy_django_configurations_plugin.py",
"mypy_django_plugin.main", "mypy_django_plugin.main",
"mypy_drf_plugin.main", "mypy_drf_plugin.main",
] ]
[tool.django-stubs] [tool.django-stubs]
django_settings_module = "cmsmanage.settings.dev" django_settings_module = "cmsmanage.settings"
strict_settings = false
[[tool.pdm.source]] [[tool.pdm.source]]
url = "https://pypi.org/simple" url = "https://pypi.org/simple"