Skip to content

Search for interpreters in all paths found in PATH variable #2575

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

Merged
merged 3 commits into from
Sep 13, 2018

Conversation

DonJayamanne
Copy link

Fixes #2398

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Has unit tests & system/integration tests
  • [n/a] Any new/changed dependencies in package.json are pinned (e.g. "1.2.3", not "^1.2.3" for the specified version)
  • [n/a] package-lock.json has been regenerated by running npm install (if dependencies have changed)

Copy link

@d3r3kk d3r3kk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fine.

I do think about the potential for slowness though - for those developers who have a bunch of Python interpreters installed.

Do we want to add some telemetry on the time it takes to discover all the interpreters, to see if there is value in doing something more offloaded than this solution?

searchPaths.push(path.join(pathUtils.home, p));
});
// Add support for paths such as /Users/xxx/anaconda/bin.
if (process.env.HOME) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. We know that Anaconda does something 'bespoke' and so we inject it into the search paths.

This is one of the reasons we might want to have the specific IInterpreter classes that you and I discussed the other day - you could simply query each known (registered) IInterpreter for getKnownSearchPaths or something like that.

Another one that comes to mind is pyenv, who's prescribed behaviour is to shove all the installed versions under $HOME/.pyenv...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But its a chicken or the egg...
IInterpreter is the interpreter object that represents the interpreter info. Where do we get that object from. I.e. where do we get the python interpreter info from to begin with.

@DonJayamanne DonJayamanne merged commit 7707267 into microsoft:master Sep 13, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not listing all Python interpreters on PATH named python.exe
2 participants