Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with isort 5 #97

Closed
KTibow opened this issue Nov 4, 2020 · 1 comment
Closed

Not working with isort 5 #97

KTibow opened this issue Nov 4, 2020 · 1 comment

Comments

@KTibow
Copy link

KTibow commented Nov 4, 2020

If you update isort to the latest version, which is required to use --profile, this plugin breaks:

Traceback (most recent call last):
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\plugins\manager.py", line 157, in load_plugin
    self._load()
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\plugins\manager.py", line 134, in _load
    self._plugin = self.entry_point.load()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.240.0_x64__qbz5n2kfra8p0\lib\importlib\metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.240.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8_isort.py", line 3, in <module>
    from isort import SortImports
ImportError: cannot import name 'SortImports' from 'isort' (C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\isort\__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.240.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.240.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\__main__.py", line 4, in <module>
    cli.main()
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\main\cli.py", line 22, in main
    app.run(argv)
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\main\application.py", line 363, in run
    self._run(argv)
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\main\application.py", line 350, in _run
    self.initialize(argv)
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\main\application.py", line 330, in initialize
    self.find_plugins(config_finder)
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\main\application.py", line 159, in find_plugins
    self.check_plugins.load_plugins()
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\plugins\manager.py", line 415, in load_plugins
    plugins = list(self.manager.map(load_plugin))
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\plugins\manager.py", line 302, in map
    yield func(self.plugins[name], *args, **kwargs)
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\plugins\manager.py", line 413, in load_plugin
    return plugin.load_plugin()
  File "C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\flake8\plugins\manager.py", line 164, in load_plugin
    raise failed_to_load
flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "I00" due to cannot import name 'SortImports' from 'isort' (C:\Users\Kende\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\isort\__init__.py).

When you downgrade it again it works.

blueyed added a commit to blueyed/covimerage that referenced this issue May 16, 2021
blueyed added a commit to blueyed/covimerage that referenced this issue Sep 11, 2021
kevinoid added a commit to kevinoid/python-project-template that referenced this issue Oct 11, 2021
flake8-isort is apparently abandoned.  It does not support current
versions of flake8 <gforcada/flake8-isort#103>
or isort <gforcada/flake8-isort#97> and the
most recent commit is over a year old.

Signed-off-by: Kevin Locke <[email protected]>
@fdemmer
Copy link

fdemmer commented Aug 5, 2022

Strage... there is this comment in an isort issue mentioning support, but it still seems to be broken :(

A broken example pipeline would be that of django-oauth-toolkit.

Edit: Nevermind me! I see now that build is using flake8-isort==3.0.0 for some reason.

@gforcada gforcada closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants