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

Docs: Using bundled isort or not? #341

Closed
thernstig opened this issue Oct 24, 2023 · 5 comments
Closed

Docs: Using bundled isort or not? #341

thernstig opened this issue Oct 24, 2023 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug documentation Improvements or additions to documentation triage-needed Issue is not triaged.

Comments

@thernstig
Copy link

The README.md says:

The bundled isort is only used if there is no installed version of isort found in the selected python environment.

Then further down it says the default setting is:

isort.importStrategy useBundled

Setting to choose where to load isort from. useBundled picks isort bundled with the extension. fromEnvironment uses isort available in the environment.

Doesn't these contradict eachother?
With all default settings, does it use the isort found in the environment, or the one bundled with the extension?

@github-actions github-actions bot added the triage-needed Issue is not triaged. label Oct 24, 2023
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug documentation Improvements or additions to documentation labels Oct 24, 2023
@karthiknadig
Copy link
Member

With "isort.importStrategy" : "useBundled" (which is default) it uses the one shipped in the extension.

This description needs to be updated.

@thernstig
Copy link
Author

thernstig commented Oct 25, 2023

So users who install an isort version themselves in a Python environment definitely should change it to fromEnvironment?

I think it would be great if it worked like auto-discovery as another option i.e. "auto" or "autoDiscover" where it selects the one from the environment if it exists, otherwise the bundled one.

@karthiknadig
Copy link
Member

So users who install an isort version themselves in a Python environment definitely should change it to fromEnvironment?

Correct.

The fromEnvironment scenario should work in the way where it attempts to load isort from the environment, and uses isort shipped with the extension as fallback.

@thernstig
Copy link
Author

@karthiknadig the VS Code Ruff extension prefers fromEnvironment first (and also falls back) which is much more intuitive. Especially since you fall back.

Otherwise all projects who have workspace settings need to change this config, which they most likely want if they also run isort in CI.

@luabud
Copy link
Member

luabud commented Dec 13, 2023

We made some changes to the README to clarify how the settings work and the default values: https://github.com/microsoft/vscode-isort/blob/main/README.md. I'm closing this issue as addressed but let us know if there's still more clarifications we can make there and I can reopen 😊

And if you want you can also file a new feature request for adding an "auto" value for importStrategy so we can gauge interest from the community!

@luabud luabud closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug documentation Improvements or additions to documentation triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

3 participants