-
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
Does not recognize reexported modules #3409
Comments
These symbols are imported but not re-exported. Since this is a "py.typed" library, symbols must be explicitly re-exported if that is the intent. For additional details about how pyright treats "py.typed" libraries, refer to this documentation. I'm going to close this because the current behavior is "as designed". Please file bugs with the maintainers of this library if you think that these symbols should be explicitly re-exported through this submodule. |
Thank you for your reply.
According to the doc that you linked and mypy
|
While |
The command-line version of pyright has an option called When I run
That unfortunately means this library has a long way to go before it is properly typed. You may find that it's best to manually delete the "py.typed" marker for the library because it's probably doing more harm than good at this point. When the "py.typed" marker is present, pyright treats the library more strictly under the assumption that the library maintainers have done the additional work to provide accurate type information. When "py.typed" isn't present, pyright will loosen its rules and attempt to infer type information from the available source code if you enable the |
Now I see why it fails. Thank you erictraut for explaining it. I appreciate it. 🙏 |
It looks like MyPy and Pyright currently require imports like these to be re-exported in order to be used. Doing this raises a lint error for me due to Pyright: ```python import aw_client aw_client.ActivityWatchClient() # "ActivityWatchClient" is not exported from module "aw_client" ``` Ref: https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface Ref: microsoft/pyright#3409 Ref: python/mypy#8754 (comment)
It looks like MyPy and Pyright currently require imports like these to be re-exported in order to be used. Doing this raises a lint error for me due to Pyright: ```python import aw_client aw_client.ActivityWatchClient() # "ActivityWatchClient" is not exported from module "aw_client" ``` Ref: https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface Ref: microsoft/pyright#3409 Ref: python/mypy#8754 (comment)
Describe the bug
Pyright shows a
not exported from module
error for modules that are correctly reexported, althoughXMLFile
imported in the same way seems to be correct.To Reproduce
Install
Twisted==22.2.0
Import the following modules
Expected behavior
No error is shown
Screenshots or Code
Twisted template modules are reexported in
/usr/local/pyenv/versions/3.10.2/envs/foo/lib/python3.10/site-packages/twisted/web/template.py
The text was updated successfully, but these errors were encountered: