-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Python refactor: Sort imports does not work with setuptools 49.2 #12949
Comments
The issue with isort has been fixed in 5.1.0 but I believe the extension ships with some older version. Setting isort path to installed in workspace venv produces this traceback in dev console:
Running |
Maybe run isort with |
Things did not change with isort 5.1.1 - |
I ran into this problem. I was able to “fix” it by editing sys.stdin = io.BytesIO(stdin.read())
# End workaround
import setuptools # <— insert this line
import isort.main
isort.main.main() |
None of workaround specified so far has worked for me. i.e, downgrading setuptools to <49.2 or adding import statement in |
True, isort >5.1.0 fix it. @OutOfFocus4 @zgoda @jahan01 Now, I am having a weird behavior: Here the Output pane when I sort with one args set for isort:
-With my env's isort
If I read in another issue that we can set isort args in a config file (#5840 (comment)). |
@zgoda I am able to reproduce this issue with the version you specified, thanks. However with the latest version, I no longer see this issue, please upgrade to the latest extension and let me know. Can you please try setting
That's apparently not true. Quoting the docs: "If any warning is found, the command will exit with an error code" |
Extension version v2020.7.94776 Vendored isort still throws an exception and does not work if setuptools 49.2 is installed in PYTHONPATH. Custom provided isort 5.1.4 works fine. |
can confirm. downgraded setuptools to 49.1 and it works again |
For some reason, I am unable to repro the issue reliably - but I do see it. Seems to me that we can either go with @OutOfFocus4 's approach or pinning setuptools, as Pylint is not yet compatible with isort 5. |
We're going to upgrade isort and make sure it doesn't break pylint. Pylint is installed within the user environment itself, which will have it's own copy of isort. My guess is we pick that isort instead of the one shipped with the extension when using the pylint command, in my case:
but this is something to double check as well. |
Some concerns with upgrading isort: #12932 (comment) |
Downloading isort-5.3.2-py3-none-any.whl (93 kB) |
Import, install , isort many commands do not work. Anaconda3 prompt does not recognize all those commands and I can not open Jupyter notebook and others, Recently I installed conda3, my previous version was working fine which I delete because some files was missing. I tried lots of command did not work. Anaconda Doc I Read all, no solution I have seen. |
Upgraded isort. Should be fixed in the next release |
Mr. RajNothing workI may be send some clue not sure
…-----Original Message-----
From: Kartik Raj <[email protected]>
To: microsoft/vscode-python <[email protected]>
Cc: uksaha <[email protected]>; Comment <[email protected]>
Sent: Thu, Aug 13, 2020 1:42 pm
Subject: Re: [microsoft/vscode-python] Python refactor: Sort imports does not work with setuptools 49.2 (#12949)
Closed #12949.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
It'll be fixed in the NEXT RELEASE which is scheduled in a month. |
Mr. RajHow far you are now, everything mess, waiting long,almost every week I tried same asPlease let me know
Uttam
…-----Original Message-----
From: Kartik Raj <[email protected]>
To: microsoft/vscode-python <[email protected]>
Cc: uksaha <[email protected]>; Comment <[email protected]>
Sent: Sat, Aug 15, 2020 4:10 am
Subject: Re: [microsoft/vscode-python] Python refactor: Sort imports does not work with setuptools 49.2 (#12949)
It'll be fixed in the NEXT RELEASE which is scheduled in a month.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Fix is already out on insiders. Try the |
Removing |
Environment data
python.languageServer
setting: JediExpected behaviour
Calling "Python refactor: Sort imports" from command palette sorts import in active document
Actual behaviour
Nothing happens
Steps to reproduce:
Logs
Devtools console:
Output pane:
This warning comes from isort that is installed in venv, both versions 4.3.21 and 5.0.9 (latest) produce this warning. Downgrading setuptools to <49.2 makes "Sort imports" command to work ok again - and this warning disappears. I believe this should not behave this way since even with the warning isort exit code is 0.
The text was updated successfully, but these errors were encountered: