From 1dd4f96db2f6994a2f510fe36345bd774de5f730 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:20:20 -0700 Subject: [PATCH 1/4] remove poetry warning popup --- src/managers/poetry/main.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/managers/poetry/main.ts b/src/managers/poetry/main.ts index 9e68abc8..5657a52b 100644 --- a/src/managers/poetry/main.ts +++ b/src/managers/poetry/main.ts @@ -1,7 +1,6 @@ -import { Disposable, l10n, LogOutputChannel } from 'vscode'; +import { Disposable, LogOutputChannel } from 'vscode'; import { PythonEnvironmentApi } from '../../api'; import { traceInfo } from '../../common/logging'; -import { showErrorMessage } from '../../common/window.apis'; import { getPythonApi } from '../../features/pythonApi'; import { NativePythonFinder } from '../common/nativePythonFinder'; import { PoetryManager } from './poetryManager'; @@ -20,7 +19,10 @@ export async function registerPoetryFeatures( if (poetryPath) { const version = await getPoetryVersion(poetryPath); if (!version) { - showErrorMessage(l10n.t('Poetry version could not be determined.')); + traceInfo( + 'Poetry found at {0}, but unable to determine version. Poetry features will not be enabled.', + poetryPath, + ); return; } traceInfo( From c37ad7d0898f1cc2d38fa7741e94c7ecad233edf Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:22:41 -0700 Subject: [PATCH 2/4] update type --- src/managers/poetry/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/managers/poetry/main.ts b/src/managers/poetry/main.ts index 5657a52b..8376d30f 100644 --- a/src/managers/poetry/main.ts +++ b/src/managers/poetry/main.ts @@ -1,6 +1,6 @@ import { Disposable, LogOutputChannel } from 'vscode'; import { PythonEnvironmentApi } from '../../api'; -import { traceInfo } from '../../common/logging'; +import { traceInfo, traceWarn } from '../../common/logging'; import { getPythonApi } from '../../features/pythonApi'; import { NativePythonFinder } from '../common/nativePythonFinder'; import { PoetryManager } from './poetryManager'; @@ -19,7 +19,7 @@ export async function registerPoetryFeatures( if (poetryPath) { const version = await getPoetryVersion(poetryPath); if (!version) { - traceInfo( + traceWarn( 'Poetry found at {0}, but unable to determine version. Poetry features will not be enabled.', poetryPath, ); From 166196d6512232fe0cb4399efbf318794edfcd38 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:24:53 -0700 Subject: [PATCH 3/4] add additional logs --- src/managers/poetry/poetryUtils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/managers/poetry/poetryUtils.ts b/src/managers/poetry/poetryUtils.ts index 38bfc1ed..08860972 100644 --- a/src/managers/poetry/poetryUtils.ts +++ b/src/managers/poetry/poetryUtils.ts @@ -216,6 +216,7 @@ export async function getPoetryVersion(poetry: string): Promise Date: Mon, 16 Jun 2025 13:28:00 -0700 Subject: [PATCH 4/4] update to not rely on poetry version --- src/managers/poetry/main.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/managers/poetry/main.ts b/src/managers/poetry/main.ts index 8376d30f..c13c32af 100644 --- a/src/managers/poetry/main.ts +++ b/src/managers/poetry/main.ts @@ -1,6 +1,6 @@ import { Disposable, LogOutputChannel } from 'vscode'; import { PythonEnvironmentApi } from '../../api'; -import { traceInfo, traceWarn } from '../../common/logging'; +import { traceInfo } from '../../common/logging'; import { getPythonApi } from '../../features/pythonApi'; import { NativePythonFinder } from '../common/nativePythonFinder'; import { PoetryManager } from './poetryManager'; @@ -17,18 +17,11 @@ export async function registerPoetryFeatures( try { const poetryPath = await getPoetry(nativeFinder); if (poetryPath) { - const version = await getPoetryVersion(poetryPath); - if (!version) { - traceWarn( - 'Poetry found at {0}, but unable to determine version. Poetry features will not be enabled.', - poetryPath, - ); - return; - } traceInfo( - 'The `shell` command is not available by default in Poetry versions 2.0.0 and above. Therefore all shell activation will be handled by calling `source `. If you face any problems with shell activation, please file an issue at https://github.com/microsoft/vscode-python-environments/issues to help us improve this implementation. Note the current version of Poetry is {0}.', - version, + 'The `shell` command is not available by default in Poetry versions 2.0.0 and above. Therefore all shell activation will be handled by calling `source `. If you face any problems with shell activation, please file an issue at https://github.com/microsoft/vscode-python-environments/issues to help us improve this implementation.', ); + const version = await getPoetryVersion(poetryPath); + traceInfo(`Poetry found at ${poetryPath}, version: ${version}`); const envManager = new PoetryManager(nativeFinder, api); const pkgManager = new PoetryPackageManager(api, outputChannel, envManager);