https://pantsbuild.org/ logo
#general
Title
# general
c

clever-crayon-70731

11/13/2022, 11:24 AM
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

refined-addition-53644

11/13/2022, 12:32 PM
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

clever-crayon-70731

11/13/2022, 1:54 PM
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

hundreds-father-404

11/14/2022, 5:25 PM
Great! Thanks Shantanu for the help 🙂
5 Views