-
-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mypy fails on individual file but passes when run on larger set of files #11957
Comments
cc @hephex |
This was referenced Apr 23, 2021
Merged
python/mypy#3157 seems relevant |
https://github.com/python/mypy/blob/d089891198ef470c8bec9bd7d7b50a02757c5b68/docs/source/generics.rst#decorator-factories also seems relevant to add generic typing to |
Eric-Arellano
pushed a commit
that referenced
this issue
May 15, 2021
Mypy cannot determine the type of `side_effecting` when running typecheck on a single file (see #11957). This issue has been introduced in #11936 but it seems to be caused by how mypy resolve imports and assign type at the top-level. Moving the decorator to its own module, still inside rules, helps mypy to resolve to the correct type. Tested running typecheck on all single files in the repo: ``` $ ./pants filedeps :: | grep "\.py$" | xargs -I{} ./pants typecheck {} 2>&1 | tee out.txt ... $ cat out.txt | grep fail | wc -l 0 ``` [ci skip-rust]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This fails:
with
But this succeeds:
I've bisected this to #11936.
The text was updated successfully, but these errors were encountered: