-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
MyPy.ini Make Import Machinery Explicit #26645
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
Changes from all commits
647192a
de58649
03717c2
2adac80
78e0cbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ def in_interactive_session(): | |
|
||
def check_main(): | ||
try: | ||
import __main__ as main | ||
import __main__ as main # type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was ignored and won't be fixed as stated in mypy python/mypy#658, though perhaps a better solution would be to just use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO it would be nice to put a link the related mypy issue as comment too, for people in future who might be wonder why it's been ignored. |
||
except ModuleNotFoundError: | ||
return get_option('mode.sim_interactive') | ||
return (not hasattr(main, '__file__') or | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do the cython libs have to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These throw errors like
error: No library stub file for module ‘<the_pyx_file>’
- I imagine the annotations don't find anything that gets imported.I think the only way around this may be to add stub files for the internally used aspects of the .pyx files but haven't found anything definitive yet. Also asked if anyone had experience with this on the typing Gitter but no luck yet. Stub files might not be a terrible fallback if that's all that works