You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thank you all for your work on MyPy, adding static typing to Python is a huge boon.
MyPy is hitting an exception while typechecking our project, both with version 0.720 and with master 0.730+dev.8954045912e8d7f00af5d7d6289085dd8eb8c64a on Python 3.6.5
The minimal test case which triggers the exception is:
When evaluated with a config file which contains follow_imports_for_stubs = True, as well as passing --follow-imports=skip in the commandline. Are these two incompatible? Their names almost suggest as much.
E.g.
[mypy]
follow_imports_for_stubs = True
python -m mypy --show-traceback --follow-imports=skip --config-file=example.cfg example.py
example.py:4: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.730+dev.8954045912e8d7f00af5d7d6289085dd8eb8c64a
Traceback (most recent call last):
File "/var/lib/conda/envs/py35/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/var/lib/conda/envs/py35/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/__main__.py", line 12, in<module>
main(None, sys.stdout, sys.stderr)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/main.py", line 83, in main
res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py", line 163, in build
result = _build(sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py", line 225, in _build
graph = dispatch(sources, manager, stdout)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py", line 2562, in dispatch
process_graph(graph, manager)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py", line 2871, in process_graph
process_stale_scc(graph, scc, manager)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py", line 2970, in process_stale_scc
graph[id].type_check_first_pass()
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py", line 2066, in type_check_first_pass
self.type_checker().check_first_pass()
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 291, in check_first_pass
self.accept(d)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 402, in accept
stmt.accept(self)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/nodes.py", line 756, in accept
return visitor.visit_decorator(self)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 3294, in visit_decorator
self.check_func_item(e.func, name=e.func.name())
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 788, in check_func_item
self.check_func_def(defn, typ, name)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 862, in check_func_def
if not self.is_generator_return_type(typ.ret_type, defn.is_coroutine):
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 611, in is_generator_return_type
gt = self.named_generic_type('typing.Generator', [any_type, any_type, any_type])
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 3843, in named_generic_type
info = self.lookup_typeinfo(name)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 3849, in lookup_typeinfo
sym = self.lookup_qualified(fullname)
File "/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py", line 3897, in lookup_qualified
n = self.modules[parts[0]]
KeyError: 'typing'
example.py:4: : note: use --pdb to drop into pdb
The text was updated successfully, but these errors were encountered:
It looks like follow_imports_for_stubs = True and --follow-imports=skip don't work together at the moment. They cause the stub for typing to be skipped, which will break almost everything. I don't see why they couldn't work together, though.
Hello,
First, thank you all for your work on MyPy, adding static typing to Python is a huge boon.
MyPy is hitting an exception while typechecking our project, both with version
0.720
and with master0.730+dev.8954045912e8d7f00af5d7d6289085dd8eb8c64a
on Python 3.6.5The minimal test case which triggers the exception is:
When evaluated with a config file which contains
follow_imports_for_stubs = True
, as well as passing--follow-imports=skip
in the commandline. Are these two incompatible? Their names almost suggest as much.E.g.
The text was updated successfully, but these errors were encountered: