-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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] Being able to use stub pyi
files in pylint
#4987
Comments
pyi
files in pylint
Is there any progress/update on this? This seems like a pretty common usecase nowadays and I was surprised to find out, it's not supported. Or is there at least a workaround? I couldn't find a way to have pylint just ignore imports and missing members from certain packages. |
I don't think anyone worked on it yet. I pinned the issue. Regarding the workaround some options from the typechecker could help you, in particular |
@Pierre-Sassoulas thanks for the tip with |
|
Wow, 2 years and this issue still there |
@zs-dima do you want to work on it ? |
@Pierre-Sassoulas Sounds tempting, but there are more critical gRPC things that need fixing. |
Recognize stub ``pyi`` Python files. Refs pylint-dev/pylint#4987 Co-authored-by: Jacob Walls <[email protected]>
Greetings! I'm a time traveler from the year 2023, and I'm experiencing this problem as well. |
It's fixed only on the main branch and not yet released, what version are you using ? |
Could this change be backported to the 2.x branch ? Version 3.x is not yet released and this missing feature is a real blocker on the 2.x |
There's an alpha of pylint 3.0.0 that is really stable if you want the fix right now (https://pypi.org/project/pylint/3.0.0a7/) and we're going to release 3.0.0b0 in days, and the actual 3.0.0 in a week for python 3.12 release. |
I'm seeing this with
But: https://github.com/ijl/orjson/blob/3.9.6/pysrc/orjson/__init__.pyi#L11-L13 and I verified that file is in my |
I'm running into this issue for protobuf and pylint 3.0.2 is still not working, e.g. Can we check if this is actually fixed? |
Hello, thank you for reporting a problem, but please open a new issue, or your feedback is going to get lost in this closed issue. |
Missed this, but looks promising: I still feel like we need something to pass to |
Bug description
I made some pyi files from pyd's using a stubgen program and I would like to use these pyi files for pylint.
I tried making some test cases with
*.pyi
files and they seem to be entirely ignored by pylint. I searched for other issues related to pyi/stubs and there seemed to be a few issues, but none of them said these files were just flat out unused - so I am wondering if something else is going on.This seems to work if I delete the *.pyd files and rename the *.pyi files to *.py. Is this necessary?
When I import and use these files directly, there error messages are reasonably ignorable things like:
Unfortunately, when used through an import statement:
from pylintimportstar.RealLocation import *
The messages are all errors:
Command used
Pylint output
Expected behavior
The error E1101 is not expected.
Pylint version
Maintainer note: this was a duplicate of #2873 which has 11 👍 already so this is higher priority than it appear just by sorting by thumbsup.
The text was updated successfully, but these errors were encountered: