cookie icon indicating copy to clipboard operation
cookie copied to clipboard

Review/reconsider PC140 precommit + mypy

Open Carreau opened this issue 2 weeks ago • 8 comments

I'm in the process of removing/forbiding the run of mypy via pre-commit/hatch on jupyter_client and likely other places as running via pre-commit/hach can (often?) swallow error.

try to clone jupyter client main, currently 0bce36fb216d228d755f6c1ca3473cfb4e0f29a6, and run:

$ hatch run typing:test # noerror
$ pre-commit run --all-files --hook-stage manual mypy  #no error
$ mypy  # this works and detect **real** issues.

My guess is pre-commit/hatch create envs just to run those tools, and if something goes wrong and mypy run in those envs, it may find the wrong version of your package.

Carreau avatar Dec 11 '25 12:12 Carreau