开始使用 mypy / 忽略外部库

问题描述

我正在尝试运行 mypy 类型提示,但在外部库中遇到了很多错误

我已经检查了 this topic in the docs

并有一个像这样的 mypy.ini

# Global options:

[mypy]
python_version = 3.8
; warn_return_any = True
; warn_unused_configs = True

# Per-module options:

[httplib2]
ignore_missing_imports = True

[google.cloud]
ignore_missing_imports = True

但是当我运行 mypy 时,它仍然用这些错误填充控制台。 而且,具有讽刺意味的是,在我自己的代码中没有发现任何故意的错误

(venv) dcollier@dcsan:~/dev/kzen$ mypy cxutils/digger/chat_stat.py 
cxutils/gbot.py:11: error: Skipping analyzing 'httplib2': found module but no type hints or library stubs
cxutils/logit.py:10: error: Skipping analyzing 'google.cloud': found module but no type hints or library stubs
cxutils/logit.py:12: error: Skipping analyzing 'ansimarkup': found module but no type hints or library stubs
cxutils/biglib.py:18: error: Skipping analyzing 'pandas_gbq': found module but no type hints or library stubs

... etc

我在 virtualenv 中使用 mypy,which mypy 证实了这一点。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)