I first hit this `mypy` error this morning <on a b...
# development
b
I first hit this
mypy
error this morning on a branch for changes unrelated to the code in this failure. I've rebased against the latest code in
main
and am still seeing the error in my branch, but not in
main
. Any idea why I'd be seeing this?
h
Hey Nathan, yeah, this is https://github.com/pantsbuild/pants/issues/11957. It's due to now running MyPy only on specified files rather than all the dependencies too, which is the right behavior, but introduced this issue 🤔 You can ignore it. Use --no-verify when running git commit to skip the hook
b
thanks, I'll do that
h
Should we not fix or revert that change?
h
I reverted in 2.4, I think we should fix forward in 2.5. I'm pretty sure it's a MyPy bug and not a Pants thing - MyPy is intended to work when run on a single file. At least 3 users requested this change and are successfully running MyPy that way
b
i'm not sure if this is helpful info, but that particular change on my branch passed last night, but then failed consistently this morning
h
Is there a workaround? I guess "run on more files"?
c
hey - I was looking into it these days (sorry for introducing this bug) it seems to be related to the circular dependency in process.py. I'll keep working on a fix or worksround this weekend
h
Ah! Thanks Fede! It may be fruitful to create a minimal reproduction, eg run MyPy in a dedicated repo without Pants as a variable. I'm wondering if MyPy is aware of this problem, it does sound like a MyPy bug rather than Pants bug
c
it looks like thye have a couple of issues related to this https://github.com/python/mypy/issues/7552 https://github.com/python/mypy/issues/6356 one workaround I found is moving side_effecting into a different module, that fixes the mypy check in process.py and fs.py