How to exclude a file from mypy using pants? I'm m...
# general
s
How to exclude a file from mypy using pants? I'm missing something... 😢 (I just want a single file, I don't want to use
skip_mypy
on the BUILD)
f
Use the
overrides
attribute on the relevant target to override
skip_mypy
for only the file you want. https://www.pantsbuild.org/docs/reference-python_sources#codeoverridescode
Recall that
python_sources
is a "generator target" which generates individual
python_source
targets.
And thus in this case you want to override
skip_mypy
just for the applicable
python_source
target.
s
Gracias 🙏
I didn't get the relevance of your second and third message.
Copy code
python_sources(
    overrides={
        "render_messages.py": {"skip_mypy": True}
    }
)
Is this supposed to work?
Ah, it's documented. I was missing
follow-imports
. Thanks! 🙏