flakehell install failures
Both @alex1126 and I are running into an issue where flakehell is failing to install while setting up the pre-commit hooks documented in the contributor guide:
(melty-3.8.12) ➜ meltano git:(master) poetry run pre-commit install --install-hooks
pre-commit installed at .git/hooks/pre-commit
[INFO] Installing environment for https://github.com/life4/flakehell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/Users/syn/.cache/pre-commit/repo72kapjci/py_env-python3.8/bin/python', '-mpip', 'install', '.')
return code: 1
expected return code: 0
stdout:
Processing /Users/syn/.cache/pre-commit/repo72kapjci
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
stderr:
ERROR: Command errored out with exit status 1:
command: /Users/syn/.cache/pre-commit/repo72kapjci/py_env-python3.8/bin/python /Users/syn/.cache/pre-commit/repo72kapjci/py_env-python3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/47/sydnn1xj5vv6krsn8n4krgjw0000gn/T/tmpet2njlov
cwd: /Users/syn/.cache/pre-commit/repo72kapjci
Complete output (36 lines):
Traceback (most recent call last):
File "/Users/syn/.cache/pre-commit/repo72kapjci/py_env-python3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/Users/syn/.cache/pre-commit/repo72kapjci/py_env-python3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/syn/.cache/pre-commit/repo72kapjci/py_env-python3.8/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/private/var/folders/47/sydnn1xj5vv6krsn8n4krgjw0000gn/T/pip-build-env-znhipti1/overlay/lib/python3.8/site-packages/flit_core/buildapi.py", line 49, in prepare_metadata_for_build_wheel
metadata = make_metadata(module, ini_info)
File "/private/var/folders/47/sydnn1xj5vv6krsn8n4krgjw0000gn/T/pip-build-env-znhipti1/overlay/lib/python3.8/site-packages/flit_core/common.py", line 396, in make_metadata
md_dict.update(get_info_from_module(module, ini_info.dynamic_metadata))
File "/private/var/folders/47/sydnn1xj5vv6krsn8n4krgjw0000gn/T/pip-build-env-znhipti1/overlay/lib/python3.8/site-packages/flit_core/common.py", line 193, in get_info_from_module
docstring, version = get_docstring_and_version_via_import(target)
File "/private/var/folders/47/sydnn1xj5vv6krsn8n4krgjw0000gn/T/pip-build-env-znhipti1/overlay/lib/python3.8/site-packages/flit_core/common.py", line 169, in get_docstring_and_version_via_import
m = sl.load_module()
File "<frozen importlib._bootstrap_external>", line 522, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 1022, in load_module
File "<frozen importlib._bootstrap_external>", line 847, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/syn/.cache/pre-commit/repo72kapjci/flakehell/__init__.py", line 5, in <module>
from ._cli import entrypoint, flake8_entrypoint
File "/Users/syn/.cache/pre-commit/repo72kapjci/flakehell/_cli.py", line 9, in <module>
from .commands import COMMANDS
File "/Users/syn/.cache/pre-commit/repo72kapjci/flakehell/commands/__init__.py", line 5, in <module>
from ._baseline import baseline_command
File "/Users/syn/.cache/pre-commit/repo72kapjci/flakehell/commands/_baseline.py", line 6, in <module>
from .._patched import FlakeHellApplication
File "/Users/syn/.cache/pre-commit/repo72kapjci/flakehell/_patched/__init__.py", line 2, in <module>
from ._app import FlakeHellApplication
File "/Users/syn/.cache/pre-commit/repo72kapjci/flakehell/_patched/_app.py", line 10, in <module>
from flake8.options.config import MergedConfigParser, get_local_plugins
ImportError: cannot import name 'MergedConfigParser' from 'flake8.options.config' (/private/var/folders/47/sydnn1xj5vv6krsn8n4krgjw0000gn/T/pip-build-env-znhipti1/normal/lib/python3.8/site-packages/flake8/options/config.py)
This seems to be related to https://github.com/flakehell/flakehell/issues/22 but the versions don't actually match up:
(melty-3.8.12) ➜ meltano git:(master) poetry run flakehell --version
FlakeHell 0.7.1
Flake8 3.9.2
For plugins versions use flakehell plugins
Digging some more, @edgarrmondragon found that pre-commit actually creates it own venv's and doesn't take into account pyproject.toml - and so the latest versions of flakehell/flake8 are installed - which then trigger https://github.com/flakehell/flakehell/issues/22.