smarkets / flake8-strict

Flake8 plugin that checks Python code against a set of opinionated style rules
MIT License
10 stars 8 forks source link

[FailedToLoadPlugin] Latest `black` version [21.11b0] is breaking import #41

Open mythxn opened 3 years ago

mythxn commented 3 years ago

Please see included error log,

Traceback (most recent call last):
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 157, in load_plugin
    self._load()
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 134, in _load
    self._plugin = self.entry_point.load()
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 194, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8_strict.py", line 54, in <module>
    convert=pytree.convert,
TypeError: __init__() got an unexpected keyword argument 'convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 360, in run
    self._run(argv)
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 347, in _run
    self.initialize(argv)
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 328, in initialize
    self.find_plugins(config_finder)
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/main/application.py", line 159, in find_plugins
    self.check_plugins.load_plugins()
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 415, in load_plugins
    plugins = list(self.manager.map(load_plugin))
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 302, in map
    yield func(self.plugins[name], *args, **kwargs)
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 413, in load_plugin
    return plugin.load_plugin()
  File "/root/.cache/pre-commit/reponfwscm0s/py_env-python3.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 164, in load_plugin
    raise failed_to_load
flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "S" due to __init__() got an unexpected keyword argument 'convert'.
rmazzineul commented 1 year ago

For those who have the same problem, downgrading for flake8-strict==0.2.0 seems to solve the problem