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

Fixes #22 to Detect anaconda from known locations #221

Merged
merged 19 commits into from
Nov 22, 2017

Conversation

DonJayamanne
Copy link

@DonJayamanne DonJayamanne commented Nov 14, 2017

// tslint:disable-next-line:no-require-imports no-var-requires
const untildify: (value: string) => string = require('untildify');

const KNOWN_CONDA_LOCATIONS = ['~/anaconda3/bin/conda', '~/miniconda3/bin/conda'];
Copy link
Author

Choose a reason for hiding this comment

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

@brettcannon the more I look at the code, I feel its just not future proof.
What happens when Anaconda4 comes out? Do we add anaconda4, and so on?
Making it dynamic could be slow as well, i.e. looking for directories '~/anaconda*`

Choose a reason for hiding this comment

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

Over the time I've installed different versions of miniconda on my home and work computer, and now I have all these directories: .miniconda2, miniconda, miniconda3.

Copy link
Member

Choose a reason for hiding this comment

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

I agree about the brittleness going forward. I say just do the glob match; the number of matches for that should be rather small and the number of stat calls to resolve this won't be that high.

Copy link
Author

Choose a reason for hiding this comment

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

Will go with the hacky approach for now, created an issue to be resolve separately (as I'd need to add an npm package).
#256

// tslint:disable-next-line:no-require-imports no-var-requires
const untildify: (value: string) => string = require('untildify');

const KNOWN_CONDA_LOCATIONS = ['~/anaconda3/bin/conda', '~/miniconda3/bin/conda'];
Copy link
Member

Choose a reason for hiding this comment

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

I agree about the brittleness going forward. I say just do the glob match; the number of matches for that should be rather small and the number of stat calls to resolve this won't be that high.

.then(interpreters => interpreters.filter(this.isCondaEnvironment))
.then(condaInterpreters => this.getLatestVersion(condaInterpreters))
.then(condaInterpreter => {
return condaInterpreter ? path.join(path.dirname(condaInterpreter.path), 'conda.exe') : 'conda';
Copy link
Member

Choose a reason for hiding this comment

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

Isn't assuming conda.exe a Windows-specific thing?

Copy link
Author

Choose a reason for hiding this comment

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

Should probably change the condition. Currently its implied with the existence of registryLookupForConda

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@DonJayamanne DonJayamanne added this to the December 2017 milestone Nov 17, 2017
* upstream/master:
  Fix typo in README.md (#252)
  Disable linter without workspaces (#241)
@DonJayamanne DonJayamanne changed the title Fixes #22 to Detect anaconda from known locations WIP - Fixes #22 to Detect anaconda from known locations Nov 21, 2017
* upstream/master:
  Fix feedback service (#246)
  Fix django context initializer (#248)
  disable generation of tags file upon extension load (#264)
@DonJayamanne DonJayamanne changed the title WIP - Fixes #22 to Detect anaconda from known locations Fixes #22 to Detect anaconda from known locations Nov 22, 2017
@DonJayamanne
Copy link
Author

@brettcannon fixed.

@DonJayamanne DonJayamanne merged commit fa820fe into microsoft:master Nov 22, 2017
@DonJayamanne DonJayamanne deleted the DetectAnaconda branch November 27, 2017 17:49
DonJayamanne added a commit that referenced this pull request Dec 14, 2017
* upstream/master:
  Fixes #22 to Detect anaconda from known locations  (#221)
  Use workspaceFolder token instead of workspaceRoot (#267)
  Fix registry lookup response (#224)
  Fix issues when running without debugging and debugged code terminates (#249)
@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.

No option to select Anaconda root
4 participants