I’ve recently setup torch for contributing, and as I wanted to contribute to type annotations, looked into running mypy. To my surprise, I found 17 typing errors just by running mypy
in the repo root, so I went to find out if/how this is checked in the CI, which is how I learned about lintrunner.
After setting up lintrunner and running it once, the mypy errors have disappeared!
I don’t know what changed (no files have been edited) but the new check is definitely wrong. Take for example this line:
This was one of the errors initially reported on my first mypy run: sympy.expr
doesn’t exist, it should be sympy.Expr
. Fixing that, then putting a reveal_type(new_tilings)
in the line below that and rerunning mypy gives torch.utils._ordered_set.OrderedSet[tuple[Any]]
, so apparently the lintrunner somehow changed/broke mypy in a way that it does not properly infer the type here anymore.
As I’m quite new to the project, I have no idea what could be happening here and what magic lintrunner init
does, but this is concerning as it means at least the type checking CI is currently broken.