<#16737 `./pants check` fails in the official `exa...
# github-notifications
c
#16737 `./pants check` fails in the official `example-django` repository after adding any third party dependency. Issue created by dolphinigle Reproduction https://github.com/dolphinigle/example-django It's a fork of the official django example with this small commit adding celery being the only change. Describe the bug Adding any third party library (
celery
in the following) to the
example-django
repository causes
./pants check
to fail with the following error:
Copy code
ModuleNotFoundError: No module named 'celery'
See the slack discussion: https://app.slack.com/client/T046T6T8L/C046T6T9U/thread/C046T6T9U-1661627014.305049 Pants version 2.12.0 OS Linux Additional info The root cause is that the
mypy_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. Excerpt from the slack discussion:

[Screenshot from 2022-09-01 13-10-45](https://user-images.githubusercontent.com/7020472/187844053-ea672538-e8ca-49d3-abf8-26fe7ab9fb99.png)▾

pantsbuild/pants