<#22920 Config MyPy for Django and pure python pro...
# github-notifications
q
#22920 Config MyPy for Django and pure python project in monorepo structure New discussion created by mrvafa I'm facing a configuration problem with Pants + mypy in a monorepo.
Copy code
pure_python/
django_project/
utils/
pyproject.toml
pants.toml
I’m trying to keep a monorepo layout. The problem arises when executing:
Copy code
pants check ::
I have set mypy to use django-stubs for type checking inside of django_project, but the Django-specific mypy configuration is being applied to all Python targets including pure_python. This causes errors such as:
Copy code
django_project.settings not found
because pure_python obviously has no Django settings module. I want Django type-checking with django-stubs only for django_project/. However MyPy seems to apply plugin config globally. This makes non-Django packages fail pants check. Is there a recommended way to scope mypy configuration to only certain targets / source roots so that Django settings aren't required for unrelated packages? Thanks! pantsbuild/pants