python 预提交无法安装isort 5.11.4,并显示错误“RuntimeError:诗歌配置无效”

k5hmc34c  于 2023-01-29  发布在  Python
关注(0)|答案(1)|浏览(394)

pre-commit在我们今天的构建中突然开始无法安装isort挂钩,并出现以下错误

[INFO] Installing environment for https://github.com/pycqa/isort.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/builds/.../.cache/pre-commit/repo0_h0f938/py_env-python3.8/bin/python', '-mpip', 'install', '.')
return code: 1
expected return code: 0
[...]
stderr:
      ERROR: Command errored out with exit status 1:
[...]
        File "/tmp/pip-build-env-_3j1398p/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py", line 40, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path(".").resolve(), with_groups=False)
        File "/tmp/pip-build-env-_3j1398p/overlay/lib/python3.8/site-packages/poetry/core/factory.py", line 57, in create_poetry
          raise RuntimeError("The Poetry configuration is invalid:\n" + message)
      RuntimeError: The Poetry configuration is invalid:
        - [extras.pipfile_deprecated_finder.2] 'pip-shims<=0.3.4' does not match '^[a-zA-Z-_.0-9]+$'

这似乎与诗歌的构形有关......

6tqwzwtp

6tqwzwtp1#

将钩子升级到新发布的isort 5.12.0似乎可以解决这个问题。
查看来自isort repo的提交堆栈,听起来像是最新版本的Poetry有一个与isort〈= 5.11.4(commit)不兼容的破坏性更改

相关问题