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

Auto select pipenv and poetry environments created for a workspace #23102

Merged
merged 10 commits into from
Mar 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix
Kartik Raj committed Mar 20, 2024
commit 863af5bd40275811dae7e8c11778f2d284b0652d
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ async function getSearchLocation(env: BasicEnvInfo): Promise<Uri | undefined> {
if (env.kind === PythonEnvKind.Pipenv) {
// Pipenv environments are created only for a specific project, so they must only
// appear if that particular project is being queried.
const project = await getProjectDir(getEnvironmentDirFromPath(env.executablePath));
const project = await getProjectDir(path.dirname(path.dirname(env.executablePath)));
if (project) {
return Uri.file(project);
}
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ export async function getProjectDir(envFolder: string): Promise<string | undefin
* @param interpreterPath Absolute path to any python interpreter.
*/
async function getPipfileIfGlobal(interpreterPath: string): Promise<string | undefined> {
const envFolder = getEnvironmentDirFromPath(interpreterPath);
const envFolder = path.dirname(path.dirname(interpreterPath));
const projectDir = await getProjectDir(envFolder);
if (projectDir === undefined) {
return undefined;