python / mypy

Optional static typing for Python
https://www.mypy-lang.org/
Other
18.43k stars 2.82k forks source link

Docs for `--install-types` do not explain `no mypy cache directory` error #10863

Open cclauss opened 3 years ago

cclauss commented 3 years ago

Documentation

Docs for --install-types and --non-interactive do not mention .mypy-cache yet these options often fail (esp. in GitHub Actions, tox, pre-commit) with error: --install-types failed (no mypy cache directory) even after mkdir .mypy_cache has been run. The user may then experience a tremendous feeling of helplessness.

Probably caused by #10768 but the docs should help the user understand the misleading error message.

ddelange commented 1 year ago

Updated our make lint target with explicit cache in current working dir (install + lint in one command):

python -m mypy --install-types --non-interactive --cache-dir=.mypy_cache/

that got our CI green, would be a good default imo (e.g. behind the --non-interactive flag)

ScottLinnn commented 6 months ago

Is this fixed? I'm encountering the same error.