Skip to content

Commit 683ab83

Browse files
authored
remove poetry warning popup (#546)
fixes #503
1 parent f175a39 commit 683ab83

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/managers/poetry/main.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Disposable, l10n, LogOutputChannel } from 'vscode';
1+
import { Disposable, LogOutputChannel } from 'vscode';
22
import { PythonEnvironmentApi } from '../../api';
33
import { traceInfo } from '../../common/logging';
4-
import { showErrorMessage } from '../../common/window.apis';
54
import { getPythonApi } from '../../features/pythonApi';
65
import { NativePythonFinder } from '../common/nativePythonFinder';
76
import { PoetryManager } from './poetryManager';
@@ -18,15 +17,11 @@ export async function registerPoetryFeatures(
1817
try {
1918
const poetryPath = await getPoetry(nativeFinder);
2019
if (poetryPath) {
21-
const version = await getPoetryVersion(poetryPath);
22-
if (!version) {
23-
showErrorMessage(l10n.t('Poetry version could not be determined.'));
24-
return;
25-
}
2620
traceInfo(
27-
'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 <path-to-activate>`. 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}.',
28-
version,
21+
'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 <path-to-activate>`. 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.',
2922
);
23+
const version = await getPoetryVersion(poetryPath);
24+
traceInfo(`Poetry found at ${poetryPath}, version: ${version}`);
3025
const envManager = new PoetryManager(nativeFinder, api);
3126
const pkgManager = new PoetryPackageManager(api, outputChannel, envManager);
3227

src/managers/poetry/poetryUtils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export async function getPoetryVersion(poetry: string): Promise<string | undefin
216216
// Handle both formats:
217217
// Old: "Poetry version 1.5.1"
218218
// New: "Poetry (version 2.1.3)"
219+
traceInfo(`Poetry version output: ${stdout.trim()}`);
219220
const match = stdout.match(/Poetry (?:version|[\(\s]+version[\s\)]+)([0-9]+\.[0-9]+\.[0-9]+)/i);
220221
return match ? match[1] : undefined;
221222
} catch {

0 commit comments

Comments
 (0)