-
-
Notifications
You must be signed in to change notification settings - Fork 521
Open
Labels
bugSomething isn't workingSomething isn't workingmypy-pluginIssues specific to mypy_django_pluginIssues specific to mypy_django_plugin
Description
Bug report
What's wrong
Running mypy with DJANGO_SETTINGS_MODULE=mysite.settings and [tool.django-stubs] section missing in pyproject.toml fails:
(config)
...
[tool.django-stubs]
django_settings_module = str (default: `os.getenv("DJANGO_SETTINGS_MODULE")`)
strict_settings = bool (default: true)
strict_model_abstract_attrs = bool (default: true)
...
(django-stubs) mypy: error: no section [tool.django-stubs] found
To fix this, an empty [tool.django-stubs] sections needs to be created.
plugins = ["mypy_django_plugin.main"]
[tool.django-stubs]
# intentionally left empty, `django_settings_module` will be read from DJANGO_SETTINGS_MODULE env var
How is that should be
User shouldn't need to set a useless empty section. Only fail is [tool.django-stubs] is missing and DJANGO_SETTINGS_MODULE is not set.
System information
- OS: n/a
pythonversion: 3.14.0djangoversion: 5.2.8mypyversion: 1.18.2django-stubsversion: 5.2.7django-stubs-extversion: 5.2.7
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmypy-pluginIssues specific to mypy_django_pluginIssues specific to mypy_django_plugin