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

stub file not read when checking buffer #85

Open
CamJN opened this issue May 6, 2023 · 1 comment
Open

stub file not read when checking buffer #85

CamJN opened this issue May 6, 2023 · 1 comment

Comments

@CamJN
Copy link

CamJN commented May 6, 2023

I have a __init__.py file with some code and a __init__.pyi stub file, the types are kept in the pyi file for better backwards compatibility. In emacs, with python-mode and lsp-mode enabled in the __init__.py buffer the stub file is not read when pyright performs error checking, so I get errors like:

   15  14 error    l-d---b  Type annotation is missing for parameter "pid"     
   15  14 error    l-d---b  Type of parameter "pid" is unknown                 
   15  19 error    l-d---b  Type annotation is missing for parameter "encoding"
   15  19 error    l-d---b  Type of parameter "encoding" is unknown            
   15  29 error    l-d---b  Type annotation is missing for parameter "skip"    
   15  39 error    l-d---b  Type annotation is missing for parameter "nuls"    
   17  20 error    l-d---b  Argument type is unknown                           
   17  44 error    l-d---b  Argument type is unknown                           
   19  19 error    l-d---b  Type annotation is missing for parameter "pid"     
   19  19 error    l-d---b  Type of parameter "pid" is unknown                 
   19  24 error    l-d---b  Type annotation is missing for parameter "encoding"
   19  24 error    l-d---b  Type of parameter "encoding" is unknown            
   21  21 error    l-d---b  Argument type is unknown                           
   21  48 error    l-d---b  Argument type is unknown                           

But the types are present in the stub file as verified with pyright --verifytypes getargv on the cli.

@CamJN
Copy link
Author

CamJN commented Jul 29, 2023

I’ve tried putting the stubs in a typings sub directory, didn’t work; I also tried setting the stub path in pyproject.toml to src, also didn’t work.

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

No branches or pull requests

1 participant