Skip to content

Commit e54947e

Browse files
authored
Update interpreter display (#3)
* Add support for multi roots for formatting and linting (#1281) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified to settings are resolved using document uri * 1228 multi root master (#1) * fix #1280 handle env in shebang (#1290) * handle shebangs that resolve paths from env * oops * make test more specific * handle promise * fix #1282 use PYTHONIOENCODING variable (#1291) * fix #1270 debugger contribution changes (#1288) * add onDebug activation * use debug config provider for non workspace debugging * forgot to save file before commiting a merge * ability to opt out of telemetry using vscode settings (#1297) * Fix #1284 debugging parameterized tests (#1299) * fix #1298 remove vscode.startDebug command (#1300) * fix #1298 remove vscode.startDebug command * fix code review comments * added period as per code review comments * #1288 installer config and tests (#1302) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * fixed code review comments * fixed code review comments * fix #1276 Pre-commit hooks to ensure code complies with standards (#1277) * sanitize code * gulp file to check code hygiene * fix preLaunchTask in launch.json * added missing packages * enabled pre-commit using husky * enabled a few checks for precommit hook * fix tslint warnings when running tslint via gulp * exclude webpack building, else tries to pull in tests as well * improved checks for commits (strict) * added new lines * 1228 multi root workspace symbols (#1307) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * #1228 workspace symbols with multiroot support * fix test * added some data for workspace symbol tests * data for unit tests * fixed to add support for multit roots with unit tests * account for mutiroot files in sub directory * disable all but multiroot tests * fixed tests * include files for tests * Fixed travis tests for multi root workspace symbols (#1306) * added logging * more logging * yay * fixed * more fixes * fix tests * removed logging * enable all tests * uncommented * Added brackets around print statements (for p3) * Fixed travis unit tests (#1308) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * #1228 workspace symbols with multiroot support * fix test * added some data for workspace symbol tests * data for unit tests * fixed to add support for multit roots with unit tests * account for mutiroot files in sub directory * disable all but multiroot tests * fixed tests * fix tests * test where failing * properly determine root workspace * fix pytest unit test * delete files * add awaiter * use a path that works on multiple os * fixes * uncomment * invert * debug statements * use default workspace * reverted unwanted changes * oops * test unittests only * more logging * partial fixes to unit tests * run all tests * changes not to set paths for shebang tests * remove comments * update settings only if necessary * fix test * include files for tests * Fixed travis tests for multi root workspace symbols (#1306) * added logging * more logging * yay * fixed * more fixes * fix tests * removed logging * enable all tests * uncommented * Added brackets around print statements (for p3) * use resource when getting settings * fix #1315 unit tests need to wait for extension to activate (#1316) * fix #1314 allow for simultaneous language features (#1317) * #1228 support multi roots in language service (#1309) * update to use latest api * config changes for multiroot workspace * linting support with multi roots * multi root support for formatters * determine workspace root path * revert change * support multiple configs per workspace folder * modify formatters to use resource specific settings * modified installer to pass resource for workspace resolution * null test in installer * canges to config settings to support multiroot workspace * changes to code refactoring to support workspace symbols * oops * modified to settings are resolved using document uri * unit tests for multi root support * fix unittests for multiroot * exclude files * add new line * config changes for multiroot workspace * new lines and enabled multi root linter tests * fix sys variables * added unit test to resolve ${workspaceRoot} in settings.json * #1228 workspace symbols with multiroot support * fix test * added some data for workspace symbol tests * data for unit tests * fixed to add support for multit roots with unit tests * account for mutiroot files in sub directory * disable all but multiroot tests * fixed tests * fix tests * test where failing * properly determine root workspace * fix pytest unit test * delete files * add awaiter * use a path that works on multiple os * fixes * uncomment * invert * debug statements * use default workspace * reverted unwanted changes * oops * test unittests only * more logging * partial fixes to unit tests * run all tests * changes not to set paths for shebang tests * remove comments * update settings only if necessary * fix test * include files for tests * Fixed travis tests for multi root workspace symbols (#1306) * added logging * more logging * yay * fixed * more fixes * fix tests * removed logging * enable all tests * uncommented * Added brackets around print statements (for p3) * use resource when getting settings * support multiroot in language services * add additional tests for #1314 (#1318) * #1228 run all tests under multiroot (#1322) * modifications to fix tests to run under multi root setup * log errors * fix return type * fix linter messages * fix linter errors * changes to ensure code is formatted correctly * fixed comments * delete unwanted file * hide unwanted folders * fixes to linters to run on multiroot setup * udpate settings sequentially * log the output * show errors in deleting dir * removed prospector test, to be completed in #1319 * fixes to tests and sorting provider * fixed test for interpreter display * undo commenting of code * add new line * fix code review issues * ensure else is properly formatted * fix code review comments * fix #1304 preserve empty lines (#1329) * #1228 multiroot interpreter display (#1339) * modifications to fix tests to run under multi root setup * log errors * fix return type * fix linter messages * fix linter errors * changes to ensure code is formatted correctly * fixed comments * delete unwanted file * hide unwanted folders * fixes to linters to run on multiroot setup * udpate settings sequentially * log the output * show errors in deleting dir * removed prospector test, to be completed in #1319 * fixes to tests and sorting provider * fixed test for interpreter display * undo commenting of code * add new line * support multi root in interpreter display * fix linter * changed package version * disabled multiroot test * backwards compatible change * fix nose tests * revert change * enable test but disable it * multi root support in utils.ts * fixed #1328 * retries for flaky unit tests * retry beforeEach * common retry decorator * enable telemetry for extension loads * disable jupyter tests in multiroot tests * clean up python Path before and after testsclean up python Path before and after tests * rename test env variable * dispose cfg settings * dispose cfg settings * update comment * clean up * rearrange to ensurfe launching ext is first debug option * bug fix for display name * resolved code review comment * Fixed typp * 1228 multiroot interpreter ui changes (#1345) * fixes to unit tests and forgotten multiroot * globally retry all tests 3 times * refactor changing interpreters * added tests * fixed linter * removed redundant files * removed unwanted grep * remove blank line * fix 948 remove hardcoding of port number (#1353) * fix #1041 when debugging a test do not cancel it when re-discovering tests (#1354) * fix 1041 when debugging a test do not cancel it when re-discovering tests * create enum for creation of cancellation token * dispose correct cancellationToken * bug fix - in unit tests * bug fix - in unit tests * #1228 multiroot unit test runner (#1357) * fixes to unit tests and forgotten multiroot * globally retry all tests 3 times * refactor changing interpreters * added tests * fixed linter * removed redundant files * temp changes * more changes * lots of refactoring * adding support for multiroot workspaces * removed grep * copy changes for #948 and #1353 into multroot * replicate solution for #1041 and #1354 * #1041 create enum for creation of cancellation token * multiroot support for unit tests * remove empty line (linter warning) * delete pyc before making changes to py file * delete pyc file in teardown * merged multiroot master * pass uri of workspace when displaing prompt for configuration * pass uri to commands * fixed typos based on code review * prefix path with forward slash, as is done in the extension unit tests * include version number into display name
1 parent 2bc6b2e commit e54947e

File tree

5 files changed

+124
-38
lines changed

5 files changed

+124
-38
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
import { IS_WINDOWS } from "../../../common/utils";
1+
import { IS_WINDOWS } from '../../../common/utils';
22

33
// where to find the Python binary within a conda env.
44
export const CONDA_RELATIVE_PY_PATH = IS_WINDOWS ? ['python.exe'] : ['bin', 'python'];
5+
// tslint:disable-next-line:variable-name
56
export const AnacondaCompanyNames = ['Anaconda, Inc.', 'Continuum Analytics, Inc.'];
7+
// tslint:disable-next-line:variable-name
68
export const AnacondaCompanyName = 'Anaconda, Inc.';
9+
// tslint:disable-next-line:variable-name
710
export const AnacondaDisplayName = 'Anaconda';
11+
// tslint:disable-next-line:variable-name
12+
export const AnacondaIdentfiers = ['Anaconda', 'Conda', 'Continuum'];
13+
14+
export type CondaInfo = {
15+
envs?: string[];
16+
'sys.version'?: string;
17+
'python_version'?: string;
18+
default_prefix?: string;
19+
};

src/client/interpreter/locators/services/condaEnvService.ts

+17-30
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,35 @@ import * as path from 'path';
55
import { Uri } from 'vscode';
66
import { VersionUtils } from '../../../common/versionUtils';
77
import { IInterpreterLocatorService, PythonInterpreter } from '../../contracts';
8-
import { AnacondaCompanyName, AnacondaDisplayName, CONDA_RELATIVE_PY_PATH } from './conda';
8+
import { AnacondaCompanyName, CONDA_RELATIVE_PY_PATH, CondaInfo } from './conda';
9+
import { CondaHelper } from './condaHelper';
910

10-
type CondaInfo = {
11-
envs?: string[];
12-
'sys.version'?: string;
13-
default_prefix?: string;
14-
};
1511
export class CondaEnvService implements IInterpreterLocatorService {
12+
private readonly condaHelper = new CondaHelper();
1613
constructor(private registryLookupForConda?: IInterpreterLocatorService) {
1714
}
18-
public getInterpreters(resource?: Uri) {
15+
public async getInterpreters(resource?: Uri) {
1916
return this.getSuggestionsFromConda();
2017
}
2118
// tslint:disable-next-line:no-empty
2219
public dispose() { }
23-
public getCondaFile() {
20+
public async getCondaFile() {
2421
if (this.registryLookupForConda) {
2522
return this.registryLookupForConda.getInterpreters()
2623
.then(interpreters => interpreters.filter(this.isCondaEnvironment))
2724
.then(condaInterpreters => this.getLatestVersion(condaInterpreters))
2825
.then(condaInterpreter => {
2926
return condaInterpreter ? path.join(path.dirname(condaInterpreter.path), 'conda.exe') : 'conda';
3027
})
31-
.then(condaPath => {
28+
.then(async condaPath => {
3229
return fs.pathExists(condaPath).then(exists => exists ? condaPath : 'conda');
3330
});
3431
}
3532
return Promise.resolve('conda');
3633
}
3734
public isCondaEnvironment(interpreter: PythonInterpreter) {
38-
return (interpreter.displayName || '').toUpperCase().indexOf('ANACONDA') >= 0 ||
39-
(interpreter.companyDisplayName || '').toUpperCase().indexOf('CONTINUUM') >= 0;
35+
return (interpreter.displayName ? interpreter.displayName : '').toUpperCase().indexOf('ANACONDA') >= 0 ||
36+
(interpreter.companyDisplayName ? interpreter.companyDisplayName : '').toUpperCase().indexOf('CONTINUUM') >= 0;
4037
}
4138
public getLatestVersion(interpreters: PythonInterpreter[]) {
4239
const sortedInterpreters = interpreters.filter(interpreter => interpreter.version && interpreter.version.length > 0);
@@ -47,8 +44,7 @@ export class CondaEnvService implements IInterpreterLocatorService {
4744
}
4845
}
4946
public async parseCondaInfo(info: CondaInfo) {
50-
// "sys.version": "3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]".
51-
const displayName = this.getDisplayNameFromVersionInfo(info['sys.version'] || '');
47+
const displayName = this.condaHelper.getDisplayName(info);
5248

5349
// The root of the conda environment is itself a Python interpreter
5450
// envs reported as e.g.: /Users/bob/miniconda3/envs/someEnv.
@@ -69,47 +65,38 @@ export class CondaEnvService implements IInterpreterLocatorService {
6965
};
7066
return interpreter;
7167
})
72-
.map(env => fs.pathExists(env.path).then(exists => exists ? env : null));
68+
.map(async env => fs.pathExists(env.path).then(exists => exists ? env : null));
7369

7470
return Promise.all(promises)
7571
.then(interpreters => interpreters.filter(interpreter => interpreter !== null && interpreter !== undefined))
7672
// tslint:disable-next-line:no-non-null-assertion
7773
.then(interpreters => interpreters.map(interpreter => interpreter!));
7874
}
79-
private getSuggestionsFromConda(): Promise<PythonInterpreter[]> {
75+
private async getSuggestionsFromConda(): Promise<PythonInterpreter[]> {
8076
return this.getCondaFile()
81-
.then(condaFile => {
77+
.then(async condaFile => {
8278
return new Promise<PythonInterpreter[]>((resolve, reject) => {
8379
// interrogate conda (if it's on the path) to find all environments.
8480
child_process.execFile(condaFile, ['info', '--json'], (_, stdout) => {
8581
if (stdout.length === 0) {
86-
return resolve([]);
82+
resolve([]);
83+
return;
8784
}
8885

8986
try {
90-
const info = JSON.parse(stdout);
87+
// tslint:disable-next-line:prefer-type-cast
88+
const info = JSON.parse(stdout) as CondaInfo;
9189
resolve(this.parseCondaInfo(info));
9290
} catch (e) {
9391
// Failed because either:
9492
// 1. conda is not installed.
9593
// 2. `conda info --json` has changed signature.
9694
// 3. output of `conda info --json` has changed in structure.
9795
// In all cases, we can't offer conda pythonPath suggestions.
98-
return resolve([]);
96+
resolve([]);
9997
}
10098
});
10199
});
102100
});
103101
}
104-
private getDisplayNameFromVersionInfo(versionInfo: string = '') {
105-
if (!versionInfo) {
106-
return AnacondaDisplayName;
107-
}
108-
109-
const versionParts = versionInfo.split('|').map(item => item.trim());
110-
if (versionParts.length > 1 && versionParts[1].indexOf('conda') >= 0) {
111-
return versionParts[1];
112-
}
113-
return AnacondaDisplayName;
114-
}
115102
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { AnacondaDisplayName, AnacondaIdentfiers, CondaInfo } from './conda';
2+
3+
export class CondaHelper {
4+
public getDisplayName(condaInfo: CondaInfo = {}): string {
5+
const pythonVersion = this.getPythonVersion(condaInfo);
6+
7+
// Samples.
8+
// "3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]".
9+
// "3.6.2 |Anaconda, Inc.| (default, Sep 21 2017, 18:29:43) \n[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]".
10+
const sysVersion = condaInfo['sys.version'];
11+
if (!sysVersion) {
12+
return pythonVersion ? `Python ${pythonVersion} : ${AnacondaDisplayName}` : AnacondaDisplayName;
13+
}
14+
15+
// Take the first two parts of the sys.version.
16+
const sysVersionParts = sysVersion.split('|').filter((_, index) => index < 2);
17+
if (sysVersionParts.length > 0) {
18+
if (pythonVersion && sysVersionParts[0].startsWith(pythonVersion)) {
19+
sysVersionParts[0] = `Python ${sysVersionParts[0]}`;
20+
} else {
21+
// The first part is not the python version, hence remove this.
22+
sysVersionParts.shift();
23+
}
24+
}
25+
26+
const displayName = sysVersionParts.map(item => item.trim()).join(' : ');
27+
return this.isIdentifiableAsAnaconda(displayName) ? displayName : `${displayName} : ${AnacondaDisplayName}`;
28+
}
29+
private isIdentifiableAsAnaconda(value: string) {
30+
const valueToSearch = value.toLowerCase();
31+
return AnacondaIdentfiers.some(item => valueToSearch.indexOf(item.toLowerCase()) !== -1);
32+
}
33+
private getPythonVersion(condaInfo: CondaInfo): string | undefined {
34+
// Sample.
35+
// 3.6.2.final.0 (hence just take everything untill the third period).
36+
const pythonVersion = condaInfo.python_version;
37+
if (!pythonVersion) {
38+
return undefined;
39+
}
40+
return pythonVersion.split('.').filter((_, index) => index < 3).join('.');
41+
}
42+
}

src/test/interpreters/condaEnvService.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Uri } from 'vscode';
44
import { PythonSettings } from '../../client/common/configSettings';
55
import { IS_WINDOWS } from '../../client/common/utils';
66
import { PythonInterpreter } from '../../client/interpreter/contracts';
7-
import { AnacondaCompanyName } from '../../client/interpreter/locators/services/conda';
7+
import { AnacondaCompanyName, AnacondaDisplayName } from '../../client/interpreter/locators/services/conda';
88
import { CondaEnvService } from '../../client/interpreter/locators/services/condaEnvService';
99
import { initialize, initializeTest } from '../initialize';
1010
import { MockProvider } from './mocks';
@@ -55,33 +55,33 @@ suite('Interpreters from Conda Environments', () => {
5555

5656
const path1 = path.join(info.envs[0], IS_WINDOWS ? 'python.exe' : 'bin/python');
5757
assert.equal(interpreters[0].path, path1, 'Incorrect path for first env');
58-
assert.equal(interpreters[0].displayName, 'Anaconda (numpy)', 'Incorrect display name for first env');
58+
assert.equal(interpreters[0].displayName, `Anaonda 4.4.0 (64-bit) : ${AnacondaDisplayName} (numpy)`, 'Incorrect display name for first env');
5959
assert.equal(interpreters[0].companyDisplayName, AnacondaCompanyName, 'Incorrect company display name for first env');
6060
});
6161
test('Must use the default display name if sys.version is empty', async () => {
6262
const condaProvider = new CondaEnvService();
6363
const info = {
64-
envs: [path.join(environmentsPath, 'conda', 'envs', 'numpy')],
64+
envs: [path.join(environmentsPath, 'conda', 'envs', 'numpy')]
6565
};
6666
const interpreters = await condaProvider.parseCondaInfo(info);
6767
assert.equal(interpreters.length, 1, 'Incorrect number of entries');
6868

6969
const path1 = path.join(info.envs[0], IS_WINDOWS ? 'python.exe' : 'bin/python');
7070
assert.equal(interpreters[0].path, path1, 'Incorrect path for first env');
71-
assert.equal(interpreters[0].displayName, 'Anaconda (numpy)', 'Incorrect display name for first env');
71+
assert.equal(interpreters[0].displayName, `${AnacondaDisplayName} (numpy)`, 'Incorrect display name for first env');
7272
assert.equal(interpreters[0].companyDisplayName, AnacondaCompanyName, 'Incorrect company display name for first env');
7373
});
7474
test('Must include the default_prefix into the list of interpreters', async () => {
7575
const condaProvider = new CondaEnvService();
7676
const info = {
77-
default_prefix: path.join(environmentsPath, 'conda', 'envs', 'numpy'),
77+
default_prefix: path.join(environmentsPath, 'conda', 'envs', 'numpy')
7878
};
7979
const interpreters = await condaProvider.parseCondaInfo(info);
8080
assert.equal(interpreters.length, 1, 'Incorrect number of entries');
8181

8282
const path1 = path.join(info.default_prefix, IS_WINDOWS ? 'python.exe' : 'bin/python');
8383
assert.equal(interpreters[0].path, path1, 'Incorrect path for first env');
84-
assert.equal(interpreters[0].displayName, 'Anaconda', 'Incorrect display name for first env');
84+
assert.equal(interpreters[0].displayName, AnacondaDisplayName, 'Incorrect display name for first env');
8585
assert.equal(interpreters[0].companyDisplayName, AnacondaCompanyName, 'Incorrect company display name for first env');
8686
});
8787
test('Must exclude interpreters that do not exist on disc', async () => {
@@ -169,7 +169,7 @@ suite('Interpreters from Conda Environments', () => {
169169
{ displayName: 'One', path: path.join(environmentsPath, 'path1', 'one.exe'), companyDisplayName: 'One 1', version: '1' },
170170
{ displayName: 'Anaconda', path: condaPythonExePath, companyDisplayName: 'Two 2', version: '1.11.0' },
171171
{ displayName: 'Three', path: path.join(environmentsPath, 'path2', 'one.exe'), companyDisplayName: 'Three 3', version: '2.10.1' },
172-
{ displayName: 'Seven', path: path.join(environmentsPath, 'conda', 'envs', 'numpy'), companyDisplayName: 'Continuum Analytics, Inc.' },
172+
{ displayName: 'Seven', path: path.join(environmentsPath, 'conda', 'envs', 'numpy'), companyDisplayName: 'Continuum Analytics, Inc.' }
173173
];
174174
const mockRegistryProvider = new MockProvider(registryInterpreters);
175175
const condaProvider = new CondaEnvService(mockRegistryProvider);
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import * as assert from 'assert';
2+
import { AnacondaDisplayName, CondaInfo } from '../../client/interpreter/locators/services/conda';
3+
import { CondaHelper } from '../../client/interpreter/locators/services/condaHelper';
4+
import { initialize, initializeTest } from '../initialize';
5+
6+
// tslint:disable-next-line:max-func-body-length
7+
suite('Interpreters display name from Conda Environments', () => {
8+
const condaHelper = new CondaHelper();
9+
suiteSetup(initialize);
10+
setup(initializeTest);
11+
test('Must return default display name for invalid Conda Info', () => {
12+
assert.equal(condaHelper.getDisplayName(), AnacondaDisplayName, 'Incorrect display name');
13+
assert.equal(condaHelper.getDisplayName({}), AnacondaDisplayName, 'Incorrect display name');
14+
});
15+
test('Must return at least Python Version', () => {
16+
const info: CondaInfo = {
17+
python_version: '3.6.1.final.10'
18+
};
19+
const displayName = condaHelper.getDisplayName(info);
20+
assert.equal(displayName, `Python 3.6.1 : ${AnacondaDisplayName}`, 'Incorrect display name');
21+
});
22+
test('Must return info without first part if not a python version', () => {
23+
const info: CondaInfo = {
24+
'sys.version': '3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]'
25+
};
26+
const displayName = condaHelper.getDisplayName(info);
27+
assert.equal(displayName, 'Anaconda 4.4.0 (64-bit)', 'Incorrect display name');
28+
});
29+
test('Must return info prefixed with word \'Python\'', () => {
30+
const info: CondaInfo = {
31+
python_version: '3.6.1.final.10',
32+
'sys.version': '3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]'
33+
};
34+
const displayName = condaHelper.getDisplayName(info);
35+
assert.equal(displayName, 'Python 3.6.1 : Anaconda 4.4.0 (64-bit)', 'Incorrect display name');
36+
});
37+
test('Must include Ananconda name if Company name not found', () => {
38+
const info: CondaInfo = {
39+
python_version: '3.6.1.final.10',
40+
'sys.version': '3.6.1 |4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]'
41+
};
42+
const displayName = condaHelper.getDisplayName(info);
43+
assert.equal(displayName, `Python 3.6.1 : 4.4.0 (64-bit) : ${AnacondaDisplayName}`, 'Incorrect display name');
44+
});
45+
});

0 commit comments

Comments
 (0)