Skip to content

Commit

Permalink
Using conda executable path instead of conda python path
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Raj committed Dec 19, 2018
1 parent 53f846d commit f2243cd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion build/ci/addEnvPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
data = {}
data = {}
with open(jsonPath, 'w') as outfile:
data[key] = sys.executable
if key == 'condaExecPath':
data[key] = sys.argv[3];
else:
data[key] = sys.executable
json.dump(data, outfile, sort_keys=True, indent=4)
4 changes: 4 additions & 0 deletions build/ci/templates/virtual_env_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,17 @@ jobs:
Write-Host $Env:PYTHON_VIRTUAL_ENVS_LOCATION
if( '$(platform)' -eq 'Linux' ){
$condaPythonPath = Join-Path -Path $Env:CONDA -ChildPath $(environmentExecutableFolder) | Join-Path -ChildPath python
$condaExecPath = Join-Path -Path $Env:CONDA -ChildPath $(environmentExecutableFolder) | Join-Path -ChildPath conda
}else {
$condaPythonPath = Join-Path -Path $Env:CONDA -ChildPath python
$condaExecPath = Join-Path -Path $Env:CONDA -ChildPath conda
}
& $condaPythonPath ./build/ci/addEnvPath.py $(PYTHON_VIRTUAL_ENVS_LOCATION) condaPath
& $condaPythonPath ./build/ci/addEnvPath.py $(PYTHON_VIRTUAL_ENVS_LOCATION) condaExecPath $condaExecPath
Get-Content $Env:PYTHON_VIRTUAL_ENVS_LOCATION
displayName: 'Save conda environment executable'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ suite('Activation of Environments in Terminal', () => {
path.join(EXTENSION_ROOT_DIR_FOR_TESTS, PYTHON_VIRTUAL_ENVS_LOCATION) : path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'tmp', 'envPaths.json');
const waitTimeForActivation = 5000;
type EnvPath = {
condaExecPath: string;
condaPath: string;
venvPath: string;
pipenvPath: string;
Expand Down Expand Up @@ -134,8 +135,7 @@ suite('Activation of Environments in Terminal', () => {
});
test('Should activate with conda', async () => {
await terminalSettings.update('integrated.shell.windows', 'C:\\Windows\\System32\\cmd.exe', vscode.ConfigurationTarget.Global);

await pythonSettings.update('condaPath', '/opt/python/versions/miniconda3/bin/conda', vscode.ConfigurationTarget.Global);
await pythonSettings.update('condaPath', envPaths.condaExecPath, vscode.ConfigurationTarget.Global);
await testActivation(envPaths.condaPath);
});
});

0 comments on commit f2243cd

Please sign in to comment.