-
Notifications
You must be signed in to change notification settings - Fork 765
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
Project Stubs in ./typings
are not used
#2071
Comments
We make heavy use of internal type stubs, so I don't think this is broken. We'll need additional details to help diagnose the problem you're seeing.
|
Thanks for the report. Could you please add the information in the report as described in the troubleshooting guide? |
@erictraut thanks Eric, Relevant folder structure looks like this:
I've tried specifying No @judej what information did I miss from the guide? At this point I don't know what events I need to trigger to generate logs showing the issue so it seemed unhelpful to include that, otherwise I think I've included everything? |
From your directory layout, it looks like there's a package called What are the contents of If you don't re-export it from the top-level module, then you'll need to import it from the submodule using a statement like |
All assumptions are correct. |
How is |
This is all that's in from colorlog.colorlog import ColoredFormatter |
Change that to
|
I just tested and it works with x as x form |
@erictraut amazing! It is working again, thank you for helping me get it figured out. Was pylance/pyright changed to adhere to this part of PEP 484? As I said originally, these stubs used to work without the |
Yes, a bug was fixed several months ago that addressed non-conformance with PEP 484. |
There it is. I'm glad I'm not crazy, it was starting to bug me that I couldn't get it working when it had been before. Thanks again for the help |
Environment data
Expected behaviour
Pylance uses project stub files for libraries.
Actual behaviour
Pylance does not appear to be using stubs for external libraries in
./typings
. I have a project using some external libraries that are either not typed or not sufficiently typed to make strict type checking happy so I have typed the functions that I use to get accurate typing in my project. These stubs used to be used by pylance for type checking and auto-completion but are no longer are. I can't tell you an exact version that they used to work in but It was definitely working this time last year.I have looked in the logs and see that pylance is finding the stubs folder but doesn't seem to be using them as I am seeing errors saying these functions are not typed. I have tried both settings of
useLibraryCodeForTypes
with no change in behaviour. Best guess is my own stubs are being ignored for some reason.May be related to #1197
Code Snippet / Additional information
The above
colorlog.ColoredFormatter
instantiation comes up with the following errors from pylance. The library is not typed but you will find below my stub for it that was previously working.Pylance(reportUnknownMemberType)
Pylance(reportGeneralTypeIssues)
This is my stub for
ColoredFormatter
which is the only function in this library I'm using:The text was updated successfully, but these errors were encountered: