Skip to content

How to disable pyright analysis for some dependencies? #2124

Answered by erictraut
tamuhey asked this question in Q&A
Discussion options

You must be logged in to vote

I assume that you have useLibraryCodeForTypes enabled? If so, you could disable it. By default, it's off in pyright (but on in pylance). That would explain why you're seeing poor performance because this is an untyped library, so pyright needs to do significant work to try to infer types from the source.

Another option is to generate type stubs for this library. You can either use pyright's built-in stub generation or another tool like stubgen. If you have stubs (even ones that are incomplete), pyright will use them rather than attempting to extract type information from the source code.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tamuhey
Comment options

Answer selected by tamuhey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants