Fix mypy for django-configurations
still have a lot of bad typing, but at least it runs again
This commit is contained in:
parent
a2c0707263
commit
9658366d72
12
cmsmanage/mypy_django_configurations_plugin.py
Normal file
12
cmsmanage/mypy_django_configurations_plugin.py
Normal 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)
|
@ -90,13 +90,14 @@ indent_size = 2
|
||||
|
||||
[tool.mypy]
|
||||
plugins = [
|
||||
"./cmsmanage/mypy_django_configurations_plugin.py",
|
||||
"mypy_django_plugin.main",
|
||||
"mypy_drf_plugin.main",
|
||||
]
|
||||
|
||||
[tool.django-stubs]
|
||||
django_settings_module = "cmsmanage.settings.dev"
|
||||
|
||||
django_settings_module = "cmsmanage.settings"
|
||||
strict_settings = false
|
||||
|
||||
[[tool.pdm.source]]
|
||||
url = "https://pypi.org/simple"
|
||||
|
Loading…
Reference in New Issue
Block a user