pants mypy
checks doesn't follow exclude
#19328
Replies: 1 comment
-
This is a classic problem with tools vs. tool runners. It boils down to the behavior of the tool when configured to exclude something, yet it is explicitly provided on the command-line. You see this also with IDEs. Note that mypy's config for
Here' So the only way to have this work is to tell Pants to not pass the file to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a repository configured with pants, and i want to exclude
_test.py
files from mypy/type checks.I have tried multiple combinations/ways to provide
exclude
but none of them seems to work withpants
.Here are few of my attempts:
Provide
exclude
in mypy.ini file[mypy] exclude = _test\.py$
If i run
mypy src/
, mypy excludes my test files. Butpants check ::
runs on my test files.pants check
however respects other flags provided in mymypy.ini
file though, likefollow_imports
.Provide
exclude
in CLI argumenta.
mypy --exclude '_test\.py$' src/
This works fine as I expect.test
files are excluded.b. ` pants -ldebug --print-stacktrace check --mypy-args "--exclude '_test.py$'" ::
Any suggestions on how to investigate this further ? I think my
mypy.ini
file is correct because it behaves correctly with the mypy on my system(1.1.1
), which is also the default version of pants2.16.0, which I am using. I am not sure how to use themypy
executable used bypants
though.Beta Was this translation helpful? Give feedback.
All reactions