-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
Cannot import name 'SortImports' from 'isort' #1273
Comments
isort 5.0.0 is not API compatible with isort 4.0.0. In theory, since isort follows the commonly used semantic versioning scheme this shouldn't automatically break things as they pin to <=4.0.0 until they are ready. Some plugins have not, such as flake8-isort: gforcada/flake8-isort#88. In time all plugins should come over to the new version, and I will be looking at any opportunities to help them. In the meantime you can choose to either disable the offending plugins or hold off on the major isort release. |
This also affects pylint:
|
Pylint has pinned the version in pylint-dev/pylint#2773. Updating Pylint to the latest version fixes this issue for me. |
Since Fedora rawhide now has isort 5.0.5, pylint 2.5.3 is broken. The affected portion is in pylint/checkers/imports.py,
I can submit a patch but I'm not even sure where to start. |
Pylint's solution pylint-dev/pylint#3725 |
This pins isort to a < 5.0 version, since it's no longer API compatible and flake8 is broken with >= 5.0. See PyCQA/isort#1273 Signed-off-by: Tycho Andersen <[email protected]>
This pins isort to a < 5.0 version, since it's no longer API compatible and flake8 is broken with >= 5.0. See PyCQA/isort#1273 Signed-off-by: Tycho Andersen <[email protected]>
Revert when PyCQA/isort#1273 is merged
latest isort 5.x is giving the error, add the following to your requirements.txt : |
@iamsaurabhc, it is not a bug with isort but a bug with the integration. Presuming you want all the niceties that come from isort 5, pinning 4.3.21 isn't a solution. However, it is a very reasonable stop gap until the compatible versions of dependent projects are released. This issue will remain open until the major dependent projects are updated. |
🎉 flake8-isort has included isort 5 support in their latest release! |
The nice thing about |
@adzenith I think
See: https://timothycrosley.github.io/isort/reference/isort/parse/#parsedcontent It returns the parsing results in the following format:
Let me know if this is missing anything you would like to see, or if any other APIs would be useful for you. Also, it's always great to get a sense of how people are using the APIs, so if you wouldn't mind sharing that would be helpful! If you would like to get a sense of the why behind the change, you can read a bit of background information on my blog: https://timothycrosley.com/project-8-isort5 Thanks, and I hope this is helpful! ~Timothy |
Thanks for the super fast reply! This is exactly what I need. I was using |
The pylint had to be updated to 2.6.0 since its dependencies got broken (such as isort). See also: PyCQA/isort#1273 conda-forge/pylint-feedstock#29
🎉 Pylint has now released an update with isort 5 support! |
The pylint had to be updated to 2.6.0 since its dependencies got broken (such as isort). See also: PyCQA/isort#1273 conda-forge/pylint-feedstock#29
Closing this now, as I believe most notable projects that utilize isort have now been updated to include isort 5 compatibility. For those that stumble into this issue: If you run into this error with the latest version of a library, utility, or editor that uses isort please feel empowered to open a new issue or comment here. If you maintain a project that uses isort and would like assistance in moving over please reach out or open an issue. Thanks everyone! ~Timothy |
The current version does not work anymore with the current testing stack. Due to the bump, the wrapper needed a few changes (maybe it could be dropped at some point? Version 2.3.0 (used by cinder right now) was considered too, but it requires a specific version of isort: PyCQA/isort#1273 Change-Id: I07fa32e7f49bde041d101a2d09860d0bc27acda0
* Update python-cinderclient from branch 'master' to df32f94add3b2dfcb84c63d7e7bfc146f8f0313c - Merge "Bump pylint to 2.6.0" - Bump pylint to 2.6.0 The current version does not work anymore with the current testing stack. Due to the bump, the wrapper needed a few changes (maybe it could be dropped at some point? Version 2.3.0 (used by cinder right now) was considered too, but it requires a specific version of isort: PyCQA/isort#1273 Change-Id: I07fa32e7f49bde041d101a2d09860d0bc27acda0
Hi,
I recently updated ISORT using Poetry on a clean virtualenv. I'm getting the following error when I tried to run Flake8.
flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "I00" due to cannot import name 'SortImports' from 'isort' (d:\github\crypto-candlesticks\.venv\lib\site-packages\isort\__init__.py).
Kindly let me know if there's additional information you may need, these are the virtualenv packages.
Packages
[tool.poetry.dev-dependencies]
black = "^19.10b0"
mypy = "^0.782"
sphinx = "^3.1.1"
pytest = "^5.4.3"
coverage = {extras = ["toml"], version = "^5.1"}
pytest-cov = "^2.10.0"
pytest-mock = "^3.1.1"
sphinx-autodoc-typehints = "^1.11.0"
nox = "^2020.5.24"
flake8-annotations = "^2.1.0"
flake8-bandit = "^2.1.2"
flake8-black = "^0.2.0"
flake8-docstrings = "^1.5.0"
flake8-import-order = "^0.18.1"
safety = "^1.9.0"
darglint = "^1.4.1"
wemake-python-styleguide = "^0.14.0"
xdoctest = "^0.12.0"
bump2version = "^1.0.0"
sphinx_autodoc_typehints = "^1.11.0"
isort = "^5.0.3"
The text was updated successfully, but these errors were encountered: