mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Fix: --install-types can mask failure details (#10768) (https://github.com/python/mypy/issues/10768)

Open wyattscarpenter opened this issue 1 year ago • 2 comments

It seems that: if the mypy cache dir wasn't created, this code would do an exit, preventing the actual errors from being printed. So I've removed the exit. More information is available at the issue I claim this fixes.

Fixes #10768

wyattscarpenter avatar Jul 05 '24 09:07 wyattscarpenter

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Jul 05 '24 09:07 github-actions[bot]

I should add that I've confirmed this works using https://github.com/tk-woven/mypy-install-types-mre

I've installed my patch branch as a git source in pip, and it works on the mre. In contrast, when I installed the current mypy master (mypy 1.12.0+dev.fe15ee69b9225f808f8ed735671b73c31ae1bed8 (compiled: no)) as a git source in pip, it still has the error: --install-types failed (no mypy cache directory) error.

I've been using the mypy from my patch branch as a daily driver and haven't noticed any other problems resulting from this change (although theoretically there could be some obscure edge case I just don't run into).

wyattscarpenter avatar Aug 20 '24 22:08 wyattscarpenter

As a note to myself: if this pr is accepted, or the issue is otherwise fixed, I can get rid of the workaround I added to this other project: https://github.com/databricks/databricks-sql-python/blob/main/.github/workflows/code-quality-checks.yml#L164

wyattscarpenter avatar Sep 16 '24 03:09 wyattscarpenter

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Dec 30 '24 00:12 github-actions[bot]