hi :wave: I'm using the new goal typecheck for run...
# general
c
hi ๐Ÿ‘‹ I'm using the new goal typecheck for running mypy and I'm running it only for some targets but when I run typecheck for a specific target it also runs it for its dependencies. is there a way to tell pants/mypy to ignore them?
h
Hey Fede! My understanding is MyPy ends up checking all transitive deps no matter what. Only, normally you don't experience it much because of the MyPy cache, which Pants is not yet using We do always set the argv to run over all transitive first party deps, but do you expect this to make a difference vs a more limited argv?
c
yes, I'd expected it to work similarly when running mypy over a directory (i.e.
mypy foo/
) AFAICS it only checks the given files in this way TBF eventually we should run it over all files so it's not a big deal but it will take more time to fix all the old projects
h
I believe MyPy will no matter what look at all the transitive deps - thatโ€™s how it determines what the types of imports are But it does sound plausible it wonโ€™t report on errors from those deps. If true, we could change how Pants does things. Would you have a chance to try that out? I'm afk but can try later otherwise s
c
yes, sure ๐Ÿ™‚
h
Thanks! (To clarify, I mean trying with a separate repository completely independent of pants - no need to worry about pants yet)
Hey @calm-alarm-89082, any luck on checking MyPy's behavior?
Hey @calm-alarm-89082, fyi another user confirmed that indeed you were onto something, changing the argv does impact MyPy behavior. they're going to try out implementing https://github.com/pantsbuild/pants/issues/11553 ๐Ÿ™‚
c
hey - amazing ๐Ÿ™‚ I looked into it again a couple of weeks ago but I didn't go too far
I tried to give it a go https://github.com/pantsbuild/pants/pull/11936 I created a draft PR to get some feedback as it's the first time I try to contribute to the pants project ๐Ÿ™‚
๐Ÿš€ 1
โค๏ธ 1
h
Thanks @calm-alarm-89082! I'll be near my keyboard later today and will take a look
๐Ÿ™ 1
Was test_type_stubs failing beforehand on the main branch too for you, or only as a result of your changes?
c
it failed after I changed the rule, I ran the tests for the mypy rule on the main branch and they passed