Skip to content

Errors are shown in third-party packages with inline annotations when using daemon #13140

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 Jul 16, 2022 · 2 comments · Fixed by #13768
Closed
Labels
bug mypy got something wrong priority-0-high topic-daemon dmypy

Comments

@ilevkivskyi
Copy link
Member

To reproduce:

  • Start daemon on a code that uses e.g. pytest before installing pytest
  • Install pytest (it has inline annotations)
  • Run dmypy run again and get a lot of error messages.
@ilevkivskyi ilevkivskyi added bug mypy got something wrong topic-daemon dmypy labels Jul 16, 2022
@ilevkivskyi
Copy link
Member Author

Note that restarting the daemon fixes the issue.

@JukkaL
Copy link
Collaborator

JukkaL commented Sep 23, 2022

This also happens with types-* packages. For example:

  • Start daemon on a file that imports requests using --disallow-untyped-defs
  • Install types-requests
  • Run dmypy run and get lots of errors

Again restarting the daemon helps.

JukkaL added a commit that referenced this issue Sep 29, 2022
If daemon was running and additional third party code was installed,
mypy daemon would report errors from the code. This was inconsistent 
with non-daemon mypy and the initial daemon run. If mypy was run with 
strict options, this could results lots of errors being generated.

The same code is used to silence errors from typeshed. I'm using
typeshed in the test case since it was easier to do.

I also manually verified that this works with pytest, aiohttp and some
typeshed stub packages.

Fixes #13140.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong priority-0-high topic-daemon dmypy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants