PyCQA / flake8-import-order

Flake8 plugin that checks import order against various Python Style Guides
GNU Lesser General Public License v3.0
278 stars 72 forks source link

Exception when using with flake8 v6.0.0 #191

Closed shai-bennathan closed 1 year ago

shai-bennathan commented 1 year ago

Running 'flake8 --version' from command line. When [flake8-import-order==1.18.1] + [flake8==6.0.0] is installed, the below exception is thrown. When [flake8-import-order==1.18.1] + [flake8==5.0.4] is installed, the command succeeds. When [flake8-import-order] is uninstalled, and [flake8==6.0.0] is installed, the command succeeds.

Other plugins are installed in all the above cases: flake8-blind-except==0.2.1 flake8-builtins==2.0.1 flake8-docstrings==1.6.0 flake8-rst-docstrings==0.3.0 flake8-logging-format==0.9.0

With [flake8==6.0.0] installed, the issue reproduces for all flake8-import-order versions attempted: 1.18, 1.17, 1.15, 1.10

Environments:

Exception log: (venv) PS C:\source\ait\pypekan> flake8 --version Traceback (most recent call last): File "C:\Users\shaib\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\shaib\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\source\ait\pypekan\venv\Scripts\flake8.exe__main__.py", line 7, in File "C:\source\ait\pypekan\venv\lib\site-packages\flake8\main\cli.py", line 23, in main app.run(argv) File "C:\source\ait\pypekan\venv\lib\site-packages\flake8\main\application.py", line 198, in run self._run(argv) File "C:\source\ait\pypekan\venv\lib\site-packages\flake8\main\application.py", line 186, in _run self.initialize(argv) File "C:\source\ait\pypekan\venv\lib\site-packages\flake8\main\application.py", line 165, in initialize self.plugins, self.options = parse_args(argv) File "C:\source\ait\pypekan\venv\lib\site-packages\flake8\options\parse_args.py", line 51, in parse_args option_manager.register_plugins(plugins) File "C:\source\ait\pypekan\venv\lib\site-packages\flake8\options\manager.py", line 259, in register_plugins add_options(self) File "C:\source\ait\pypekan\venv\lib\site-packages\flake8_import_order\flake8_linter.py", line 43, in add_options register_opt( File "C:\source\ait\pypekan\venv\lib\site-packages\flake8_import_order\flake8_linter.py", line 90, in register_opt parser.add_option(*args, *kwargs) File "C:\source\ait\pypekan\venv\lib\site-packages\flake8\options\manager.py", line 281, in add_option self._current_group.add_argument(option_args, **option_kwargs) File "C:\Users\shaib\AppData\Local\Programs\Python\Python310\lib\argparse.py", line 1428, in add_argument raise ValueError('%r is not callable' % (type_func,)) ValueError: 'string' is not callable

shai-bennathan commented 1 year ago

Duplicate of: https://github.com/PyCQA/flake8-import-order/issues/189

sigmavirus24 commented 1 year ago

Fix released @shai-bennathan