Skip to content

Commit e387e70

Browse files
authored
Add homebrew path to conda search list (#23171)
Fixes #23162
1 parent 4f5b347 commit e387e70

File tree

2 files changed

+14
-3
lines changed
  • src

2 files changed

+14
-3
lines changed

src/client/pythonEnvironments/common/environmentManagers/conda.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class Conda {
342342
prefixes.push(home, path.join(localAppData, 'Continuum'));
343343
}
344344
} else {
345-
prefixes.push('/usr/share', '/usr/local/share', '/opt');
345+
prefixes.push('/usr/share', '/usr/local/share', '/opt', '/opt/homebrew/bin');
346346
if (home) {
347347
prefixes.push(home, path.join(home, 'opt'));
348348
}

src/test/pythonEnvironments/common/environmentManagers/conda.unit.test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ suite('Conda and its environments are located correctly', () => {
276276
opt: {},
277277
},
278278
},
279-
opt: {},
279+
opt: {
280+
homebrew: {
281+
bin: {},
282+
},
283+
},
280284
usr: {
281285
share: {
282286
doc: {},
@@ -290,7 +294,14 @@ suite('Conda and its environments are located correctly', () => {
290294
};
291295
});
292296

293-
['/usr/share', '/usr/local/share', '/opt', '/home/user', '/home/user/opt'].forEach((prefix) => {
297+
[
298+
'/usr/share',
299+
'/usr/local/share',
300+
'/opt',
301+
'/opt/homebrew/bin',
302+
'/home/user',
303+
'/home/user/opt',
304+
].forEach((prefix) => {
294305
const condaPath = `${prefix}/${condaDirName}`;
295306

296307
test(`Must find conda in ${condaPath}`, async () => {

0 commit comments

Comments
 (0)