I've been experiencing some flakiness of the mypy ...
# general
p
I've been experiencing some flakiness of the mypy type checking lately. sometimes it complains about type errors inside our dependencies, running it a second time generally makes it go away. has anyone seen this before?
c
There are a few spooky reports in https://github.com/pantsbuild/pants/issues/18519 ; it would be wonderful to get a consistent repro case
p
this has not been at all consistent for me, is there something I could capture after a failure that would help?
FWIW, the libraries I am getting errors with are different from those mentioned in the bug:
Copy code
.cache/pex_root/venvs/d17349559f692efab258d5f40c73f81d7382b44c/2540ac6a914a2a78bfd89ca0676ffdc7f0dfe44f/lib/python3.11/site-packages/pandas-stubs/io/formats/style_render.pyi:11: error: Cannot find implementation or library stub for module named "jinja2"  [import-not-found]
.cache/pex_root/venvs/d17349559f692efab258d5f40c73f81d7382b44c/2540ac6a914a2a78bfd89ca0676ffdc7f0dfe44f/lib/python3.11/site-packages/opentelemetry/instrumentation/requests/__init__.py:57: error: Library stubs not installed for "requests.models"  [import-untyped]
c
A comment in the ticket with whatever is notable or suspicious to you would be a start (knowing it's not library specific would help). mypy versions? Did retrying help or did you need to blow away some caches? etc The ideal would be a sample repository that produces the issue consistently -- or at least often.
c
p
Nice; I'll try hardcoding to mypy 1.8.0 since I the release of 1.9.0 would line up with the problems appearing
Downgrading to 1.8.0 did not seem to help here
c
we fixed it by adding
--no-incremental
to pants mypy extra args
Copy code
[mypy]
args = ["--no-incremental"]
c
Thanks for running with this!