Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pre-commit fails to install isort 5.10.1 with error "RuntimeError: The Poetry configuration is invalid" [duplicate]

[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]+$'

I know I can upgrade the hook to isort-5.12.0 to fix the issue. However, our project are using python-3.7, isort-5.12.0 does not support it. Considering compatibility, we don't want to update python for now. What should I do?

like image 668
LOTEAT Avatar asked Nov 28 '25 08:11

LOTEAT


2 Answers

This is not a pre-commit issue but rather an Isort issue. Upgrade to the latest version of isort. It's now fixed:

https://github.com/PyCQA/isort/issues/2077 https://github.com/PyCQA/isort/pull/2078

like image 87
mrswats Avatar answered Nov 30 '25 21:11

mrswats


You can fix this in python3.7 by using rev: 5.11.5 https://github.com/PyCQA/isort/issues/2083#issuecomment-1408300628

like image 42
Tobias W. Avatar answered Nov 30 '25 23:11

Tobias W.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!