-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature request: allow "useLibraryCodeForTypes" option to be set within config file #928
Comments
Your config is invalid. "python.analysis.useLibraryCodeForTypes" is a VS Code setting, so it needs to go in your VS Code "settings.json" file. Or if you're running the command-line version of Pyright, you need to pass the "--lib" argument to the command-line. For details about the options that are supported in the config file, refer to this documentation. For details about options that are supported in VS Code settings, refer to this documentation. For details about options that you can pass to the command line, refer to this documentation. |
Maybe I just can't find it but I don't see an equivalent setting I can put in the config file that would work for both VS code and the command line. Is this by design ? |
There is no equivalent setting for the config file. You'd need to use a combination of the "python.analysis.useLibraryCodeForTypes" VS Code setting and the "--lib" switch. I think there's a good argument to add an option in the config file as well. |
Ok I see thank you ! It's not really the scope of this issue but our workflow is to only have a single config file that both the CI (command line) and IDE (VS code) use. This option would force us to commit a VS code settings file (or something like that ?). It's not a big deal but I'd rather have all the config in a single place. Also if Pyright ever works with other IDE it would force us to have one settings file per IDE to keep every body synchronized. |
This is addressed in Pyright 1.1.62, which I just published. It will also be included in the next version of Pylance. |
Describe the bug
Since pytest version 6 they pretend to have included inline type annotations. I have tried to use them with useLibraryCodeForTypes set to true but pyright still report an
reportUnknownParameterType
To Reproduce
pyright version 1.1.61
pytest version 6.0.1
Use this config:
and this test_monkeypatch.py
Expected behavior
I expect pyright to not report an error as the type looks correct to me.
VS Code extension or command-line
Command line version 1.1.61
Related pytest thread about typing: pytest-dev/pytest#7469
The text was updated successfully, but these errors were encountered: