Skip to content

Commit 59039a1

Browse files
committed
e2e
1 parent 3b5b309 commit 59039a1

File tree

4 files changed

+33
-13
lines changed

4 files changed

+33
-13
lines changed

extensions/positron-python/src/client/common/utils/localize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ export namespace CreateEnv {
522522

523523
// --- Start Positron ---
524524
export namespace Uv {
525-
export const providerDescription = l10n.t('Creates a `.venv` uv environment in the current workspace');
525+
export const providerDescription = l10n.t('Creates a uv virtual environment in the current workspace');
526526
}
527527
// --- End Positron ---
528528

src/vs/workbench/browser/positronNewProjectWizard/components/steps/pythonEnvironmentStep.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,45 +256,45 @@ export const PythonEnvironmentStep = (props: PropsWithChildren<NewProjectWizardS
256256
// Construct the feedback message for the interpreter step.
257257
const interpreterStepFeedback = () => {
258258
if (!interpretersLoading() && !interpretersAvailable()) {
259-
// For new environments, if no environment providers were found, show a message to notify
260-
// the user that interpreters can't be shown since no environment providers were found.
261-
if (envSetupType === EnvironmentSetupType.NewEnvironment) {
259+
if (context.usesUvEnv) {
262260
return (
263261
<WizardFormattedText
264262
type={WizardFormattedTextType.Warning}
265263
>
266264
{(() =>
267265
localize(
268-
'pythonInterpreterSubStep.feedback.noInterpretersAvailable',
269-
"No interpreters available since no environment providers were found."
266+
'pythonInterpreterSubStep.feedback.uvNotInstalled',
267+
"uv is not installed. Please install uv to create a uv environment."
270268
))()}
271269
</WizardFormattedText>
272270
);
273271
}
274272

275-
if (context.usesCondaEnv) {
273+
// For new environments, if no environment providers were found, show a message to notify
274+
// the user that interpreters can't be shown since no environment providers were found.
275+
if (envSetupType === EnvironmentSetupType.NewEnvironment) {
276276
return (
277277
<WizardFormattedText
278278
type={WizardFormattedTextType.Warning}
279279
>
280280
{(() =>
281281
localize(
282-
'pythonInterpreterSubStep.feedback.condaNotInstalled',
283-
"Conda is not installed. Please install Conda to create a Conda environment."
282+
'pythonInterpreterSubStep.feedback.noInterpretersAvailable',
283+
"No interpreters available since no environment providers were found."
284284
))()}
285285
</WizardFormattedText>
286286
);
287287
}
288288

289-
if (context.usesUvEnv) {
289+
if (context.usesCondaEnv) {
290290
return (
291291
<WizardFormattedText
292292
type={WizardFormattedTextType.Warning}
293293
>
294294
{(() =>
295295
localize(
296-
'pythonInterpreterSubStep.feedback.uvNotInstalled',
297-
"uv is not installed. Please install uv to create a uv environment."
296+
'pythonInterpreterSubStep.feedback.condaNotInstalled',
297+
"Conda is not installed. Please install Conda to create a Conda environment."
298298
))()}
299299
</WizardFormattedText>
300300
);

test/e2e/pages/newProjectWizard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export interface CreateProjectOptions {
174174
title: string;
175175
status?: 'new' | 'existing';
176176
rEnvCheckbox?: boolean;
177-
pythonEnv?: 'conda' | 'venv';
177+
pythonEnv?: 'conda' | 'venv' | 'uv';
178178
initAsGitRepo?: boolean;
179179
ipykernelFeedback?: 'show' | 'hide';
180180
interpreterPath?: string;

test/e2e/tests/new-project-wizard/new-project-python.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ test.describe('Python - New Project Wizard', { tag: [tags.MODAL, tags.NEW_PROJEC
7272
await verifyProjectCreation(app, projectTitle);
7373
await verifyVenEnvStarts(app);
7474
});
75+
76+
test('New env: uv environment', { tag: [tags.CRITICAL, tags.WIN] }, async function ({ app }) {
77+
const projectTitle = addRandomNumSuffix('new-uv');
78+
79+
await createNewProject(app, {
80+
type: ProjectType.PYTHON_PROJECT,
81+
title: projectTitle,
82+
status: 'new',
83+
pythonEnv: 'uv', // test relies on uv already installed on machine
84+
});
85+
86+
await verifyProjectCreation(app, projectTitle);
87+
await verifyUvEnvStarts(app);
88+
});
7589
});
7690

7791
// Helper functions
@@ -110,6 +124,12 @@ async function verifyVenEnvStarts(app: Application) {
110124
});
111125
}
112126

127+
async function verifyUvEnvStarts(app: Application) {
128+
await test.step('Verify uv environment starts', async () => {
129+
await app.workbench.console.waitForConsoleContents('(Uv: .venv) started.');
130+
});
131+
}
132+
113133
async function verifyGitFilesArePresent(app: Application) {
114134
await test.step('Verify that the .git files are present', async () => {
115135
const projectFiles = app.code.driver.page.locator('.monaco-list > .monaco-scrollable-element');

0 commit comments

Comments
 (0)