Skip to content

Silence errors from third party packages in daemon#13768

Merged
JukkaL merged 4 commits intomasterfrom
dmypy-silent-third-party-2
Sep 29, 2022
Merged

Silence errors from third party packages in daemon#13768
JukkaL merged 4 commits intomasterfrom
dmypy-silent-third-party-2

Conversation

@JukkaL
Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL commented 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.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JukkaL JukkaL merged commit 00ca6bf into master Sep 29, 2022
@JukkaL JukkaL deleted the dmypy-silent-third-party-2 branch September 29, 2022 16:47
JukkaL added a commit that referenced this pull request Nov 10, 2022
#13768 had a bug so that errors were sometimes silenced in files that
were under a directory in `sys.path`. `sys.path` sometimes includes the 
current working directory, resulting in no errors reported at all. Fix it by 
always reporting errors if a file was passed on the command line (unless
*explicitly* silenced).

When using import following errors can still be ignored, which is 
questionable, but this didn't change recently so I'm not addressing it 
here.

Fixes #14042.
svalentin pushed a commit that referenced this pull request Nov 10, 2022
#13768 had a bug so that errors were sometimes silenced in files that
were under a directory in `sys.path`. `sys.path` sometimes includes the 
current working directory, resulting in no errors reported at all. Fix it by 
always reporting errors if a file was passed on the command line (unless
*explicitly* silenced).

When using import following errors can still be ignored, which is 
questionable, but this didn't change recently so I'm not addressing it 
here.

Fixes #14042.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants