-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Disable import sorting when using Python 2.7 #14101
Comments
I've classified this as an enhancement as due to isort 5 changes and bugfixes that mean we can't stay on isort 4 with its Python 2.7 support. But we can at least help prevent you from accidentally running the sort action. |
We have the following entry in settings.json in a number of our projects, "editor.codeActionsOnSave": {
"source.organizeImports": true
}, is there a way to trigger native isort |
We do let you specify the path to isort in your settings, so if you faked it to point to something that worked for your situation then that would let you use the old version (you can a straight use of isort 4, but it's been triggering warnings for setuptools users). Otherwise you could add a task to your project to run isort the way you want. /cc @karrtikr in case I'm missing an idea. |
I think you're talking about #12949? Luckily for us the projects that are using Python 2.7 aren't using setuptools. |
@Spitfire1900 yep, that's the issue |
Hi, I encountered this issue as well while using Python 2.7.17. For me, the workaround is to set $ # Check isort version is 4.
$ isort --version
isort your Python imports for you so you don't have to
VERSION 4.3.21
$ # Get isort path.
$ which isort
/home/brian_ch_liu/.local/bin/isort In project directory, edit the VS code configuration file ( {
"python.sortImports.path": "/home/brian_ch_liu/.local/bin/isort"
} |
We no longer support Python 2.7 as its reached its EOL, hence closing this. |
The text was updated successfully, but these errors were encountered: