Skip to content
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

vscode-python causing silent dmypy failure #105

Closed
connorads opened this issue Aug 4, 2023 · 3 comments · Fixed by #107
Closed

vscode-python causing silent dmypy failure #105

connorads opened this issue Aug 4, 2023 · 3 comments · Fixed by #107
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug needs PR

Comments

@connorads
Copy link
Contributor

connorads commented Aug 4, 2023

Problem

No mypy type hints 😢

Cause

Seems like the default settings for vscode-python is setting python.linting.mypyArgs with an arg of --follow-imports=silent which is not supported by dmypy (python/mypy#9475)

Workaround

Set "python.linting.mypyArgs": [], in user or workspace settings.json

Potential fix

Would a fix be to just stop reading the legacy args here?
Happy to try a PR if so 😉

My reasoning: Given these legacy args are being deprecated in favour of plugins like this one? And that maybe the change to dmypy (#53) now warrants this?

I'm fairly new to the Python world so I hope this makes some sense 😅

Demo

In defaultSettings.json we can see python.linting.mypyArgs with an arg of --follow-imports=silent

image

We can see that vscode-mypy now reads this setting

image

And when it passes the arg to dmypy we get a message to say it's not supported, and we do not get Daemon started

image

After using the workaround we can see Daemon started and a type error in the console

image

and in the editor

image

@karthiknadig
Copy link
Member

Would a fix be to just stop reading the legacy args here?

Yes. And we are open for PRs on this.

@karthiknadig karthiknadig self-assigned this Aug 4, 2023
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug needs PR and removed triage-needed labels Aug 4, 2023
@connorads
Copy link
Contributor Author

Hey @karthiknadig, I've opened #107

@posita
Copy link
Contributor

posita commented Aug 27, 2023

I don't think merely not reading the legacy args is the solution here. I'm still encountering this, and I don't have that setting. UPDATE: I think I misunderstood. The default for python.linting.mypyArgs is non-empty and it looks like this fix juuust missed the v2023.2.0 release.

(Ref: python/mypy#9475 for visibility.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug needs PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants