我正在Mypy v0.910跑步pre-commit。它抱怨python-dateutil没有类型存根。但是,即使安装了存根后,我仍然遇到相同的错误。
我的预提交配置是
default_language_version:
python: python3
repos:
<other hooks>
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
args:
- --install-types
additional_dependencies: [tokenize-rt==3.2.0]
Run Code Online (Sandbox Code Playgroud)
当我尝试提交时,它抱怨存根不存在,然后无法安装它们。
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
coordinator/policy.py:5: error: Library stubs not installed for "dateutil.parser" (or incompatible with Python 3.7)
coordinator/policy.py:5: note: Hint: "python3 -m pip install types-python-dateutil"
coordinator/policy.py:5: note: (or run "mypy --install-types" to install all missing stub packages)
tests/test_policy.py:6: error: Cannot find implementation or library stub …Run Code Online (Sandbox Code Playgroud)