在 Python 预提交运行期间,执行以下步骤:
...
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
hooks:
- id: mypy
additional_dependencies: [types-all]
...
出现以下错误:
Run poetry run pre-commit run --all-files
...
An unexpected error has occurred: CalledProcessError: command: ('/home/runner/.cache/pre-commit/repot9s2e7uv/py_env-python3.9/bin/python', '-mpip', 'install', '.', 'types-all')
return code: 1
expected return code: 0
stdout:
...
stderr:
ERROR: Could not find a version that satisfies the requirement types-pkg-resources (from types-all) (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3)
ERROR: No matching distribution found for types-pkg-resources
这是在 GitHub 行动期间进行的,该行动迄今为止一直在正常进行。
“types-all”现已弃用。
'types-pkg-resources'是一个依赖项'types-all',该版本已被删除。
因此,
types-all
将不再起作用。下一个最好的办法是手动安装所需的 types-* 包。