I'm using Pants for a Python project and have writ...
# general
I'm using Pants for a Python project and have written some stubs for MyPy that I put into a
directory. I have a line like
mypy_path = $MYPY_CONFIG_FILE_DIR/stubs
in my config file and when I run MyPy by itself, then it uses them. However, when I run
pants check
then it does not. Pants is definitely using the same MyPy config file, though. Does anyone happen to have any ideas on how to track down the cause?
It's most probably that the files aren't being inferred as dependency and hence not available to pants. You will have to explicitly add those files as dependencies. https://pantsbuild.slack.com/archives/C046T6T9U/p1668183370941789?thread_ts=1668183370.941789&cid=C046T6T9U
I added the stubs dir to my source roots, ran
pants tailor
and added the stubs as dependencies and that seems to have done the job. Thanks!
🎉 2
Great! Thanks Shantanu for the help 🙂