I'm using Pants for a Python project and have writ...
# general
c
I'm using Pants for a Python project and have written some stubs for MyPy that I put into a
stubs
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?
1
r
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
c
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
h
Great! Thanks Shantanu for the help 🙂