Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ function getSearchLocation(env: PythonEnvInfo): Uri | undefined {
const isRootedEnv = folders.some((f) => isParentPath(env.executable.filename, f));
if (isRootedEnv) {
// For environments inside roots, we need to set search location so they can be queried accordingly.
// Search location particularly for virtual environments is intended as the directory in which the
// environment was found in.
// For eg.the default search location for an env containing 'bin' or 'Scripts' directory is:
// In certain usecases environment directory can itself be a root, for eg. `python -m venv .`.
// So choose folder to environment path to search for this env.
//
// searchLocation <--- Default search location directory
// |__ env
// |__ env <--- Default search location directory
// |__ bin or Scripts
// |__ python <--- executable
return Uri.file(path.dirname(env.location));
return Uri.file(env.location);
}
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ suite('Python envs locator - Environments Resolver', () => {
version,
arch: Architecture.Unknown,
distro: { org: '' },
searchLocation: Uri.file(path.dirname(location)),
searchLocation: Uri.file(location),
source: [],
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ suite('Resolver Utils', () => {
version,
arch: Architecture.Unknown,
distro: { org: '' },
searchLocation: Uri.file(path.dirname(location)),
searchLocation: Uri.file(location),
source: [],
};
setEnvDisplayString(info);
Expand Down