happy-kitchen-89482
08/27/2022, 7:03 PMfierce-keyboard-91032
08/28/2022, 4:49 PM./pants check ::
, I get an error ModuleNotFoundError: No module named 'celery'
.fierce-keyboard-91032
08/28/2022, 4:51 PMmypy_django_plugin
needs to load the Django models at the start, which it cannot do without the dependencies installed in the mypy
virtual environment.
Adding celery
to extra_requirements
under [mypy]
in pants.toml
removes this error, but this seems to be a hack. In my actual repo, I would need to add around fifty requirements here, which would be difficult to maintain.happy-kitchen-89482
08/28/2022, 6:48 PMhappy-kitchen-89482
08/28/2022, 6:58 PM--python-executable
flag to point it to a venv that has them installed. But the django-stubs mypy plugin doesn’t lean on that setting, it looks like. It just expects the django code to be loadable in the interpreter in which it was runhappy-kitchen-89482
08/28/2022, 6:58 PMhappy-kitchen-89482
08/28/2022, 6:58 PMhappy-kitchen-89482
08/28/2022, 7:03 PMPEX_EXTRA_SYS_PATH=.cache/pex_root/venvs/789d932fffbc7a5f62a53225281080e2a0a691f3/aa6b67e0280d525b74426f4efccdd3affff905bd/lib/python3.7/site-packages/
then the mypy invocation workshappy-kitchen-89482
08/28/2022, 7:04 PM