Skip to content

Running mypy on typeshed checkout on Widows results in errors #3446

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

Closed
ilevkivskyi opened this issue Nov 6, 2019 · 6 comments
Closed

Running mypy on typeshed checkout on Widows results in errors #3446

ilevkivskyi opened this issue Nov 6, 2019 · 6 comments
Labels
stubs: false positive Type checkers report false errors

Comments

@ilevkivskyi
Copy link
Member

I just tried checking typeshed with mypy on Windows and I get:

stdlib\2and3\formatter.pyi:5: error: Need type annotation for 'AS_IS'
stdlib\3\asyncio\__init__.pyi:116: error: Name 'SelectorEventLoop' already defined (possibly by an import)

Not a big deal, but maybe we should fix these errors.

@srittau
Copy link
Collaborator

srittau commented Nov 6, 2019

The second error makes sense, but I wonder why the first error is not flagged on other systems. There seems to be nothing Windows-specific about it. Both look easy to fix, though.

@srittau srittau added size-small stubs: false positive Type checkers report false errors labels Nov 6, 2019
@JelleZijlstra
Copy link
Member

#3425 should address this (at least the CI part of it).

@ilevkivskyi
Copy link
Member Author

but I wonder why the first error is not flagged on other systems.

This may indicate some bug in the test suite. Currently mypy test contains deeply nested cycles, I am wondering maybe there is some "indentation error" causing some files not being checked?

@JelleZijlstra
Copy link
Member

It might be a similar issue to what I fixed in #3424, where an import * injects the name into scope only on Windows.

@ilevkivskyi
Copy link
Member Author

Hm, it looks like this starts causing troubles in mypy, see CI failure in python/mypy#7794, I will make a PR now.

ilevkivskyi added a commit that referenced this issue Nov 11, 2019
Fix errors discovered by running typeshed check on Windows. This is a temporary fix for #3446 (in long term we should figure out why these were not caught by typeshed CI).

I also remove an outdated comment while I am at it.
@ilevkivskyi
Copy link
Member Author

I think this can be closed now as both relevant PRs were merged.

ilai-deutel added a commit to ilai-deutel/mypy that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

No branches or pull requests

3 participants