cool-easter-32542
05/26/2025, 6:14 AMcelery in the following) to the example-django repository causes ./pants check to fail with the following error:
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)▾
cool-easter-32542
05/26/2025, 6:14 AMcool-easter-32542
05/26/2025, 6:17 AM