Skip to content

Commit 6c90b52

Browse files
authored
Merge branch 'main' into copilot/fix-162
2 parents fd9b8c9 + f622704 commit 6c90b52

File tree

9 files changed

+27
-38
lines changed

9 files changed

+27
-38
lines changed

.github/workflows/pr-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- release*
99

1010
env:
11-
NODE_VERSION: '20.18.0'
11+
NODE_VERSION: '20.18.1'
1212

1313
jobs:
1414
build-vsix:

.github/workflows/push-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- 'release-*'
1010

1111
env:
12-
NODE_VERSION: '20.18.0'
12+
NODE_VERSION: '20.18.1'
1313

1414
jobs:
1515
build-vsix:

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.18.0
1+
20.18.1

build/azure-pipeline.pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ extends:
6666
buildSteps:
6767
- task: NodeTool@0
6868
inputs:
69-
versionSpec: '20.18.0'
69+
versionSpec: '20.18.1'
7070
displayName: Select Node version
7171

7272
- task: UsePythonVersion@0

build/azure-pipeline.stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extends:
5656
buildSteps:
5757
- task: NodeTool@0
5858
inputs:
59-
versionSpec: '20.18.0'
59+
versionSpec: '20.18.1'
6060
displayName: Select Node version
6161

6262
- task: UsePythonVersion@0

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Requirements
22

3-
1. `node` >= 20.18.0
3+
1. `node` >= 20.18.1
44
2. `npm` >= 10.9.0
55
3. `yo` >= 5.0.0 (installed via `npm install -g yo`)
66
4. `generator-code` >= 1.11.4 (installed via `npm install -g generator-code`)

src/common/localize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export namespace PackageManagement {
3636
export const enterPackageNames = l10n.t('Enter package names');
3737
export const searchCommonPackages = l10n.t('Search common `PyPI` packages');
3838
export const searchCommonPackagesDescription = l10n.t('Search and Install common `PyPI` packages');
39-
export const workspaceDependencies = l10n.t('Install workspace dependencies');
40-
export const workspaceDependenciesDescription = l10n.t('Install dependencies found in the current workspace.');
39+
export const workspaceDependencies = l10n.t('Install project dependencies');
40+
export const workspaceDependenciesDescription = l10n.t('Install packages found in dependency files.');
4141
export const selectPackagesToUninstall = l10n.t('Select packages to uninstall');
4242
export const enterPackagesPlaceHolder = l10n.t('Enter package names separated by space');
4343
export const editArguments = l10n.t('Edit arguments');

src/managers/builtin/venvUtils.ts

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -451,16 +451,22 @@ export async function quickCreateVenv(
451451
if (additionalPackages) {
452452
allPackages.push(...additionalPackages);
453453
}
454-
return await createWithProgress(
455-
nativeFinder,
456-
api,
457-
log,
458-
manager,
459-
baseEnv,
460-
venvRoot,
461-
path.join(venvRoot.fsPath, '.venv'),
462-
{ install: allPackages, uninstall: [] },
463-
);
454+
455+
// Check if .venv already exists
456+
let venvPath = path.join(venvRoot.fsPath, '.venv');
457+
if (await fsapi.pathExists(venvPath)) {
458+
// increment to create a unique name, e.g. .venv-1
459+
let i = 1;
460+
while (await fsapi.pathExists(`${venvPath}-${i}`)) {
461+
i++;
462+
}
463+
venvPath = `${venvPath}-${i}`;
464+
}
465+
466+
return await createWithProgress(nativeFinder, api, log, manager, baseEnv, venvRoot, venvPath, {
467+
install: allPackages,
468+
uninstall: [],
469+
});
464470
}
465471

466472
export async function createPythonVenv(
@@ -473,7 +479,6 @@ export async function createPythonVenv(
473479
options: { showQuickAndCustomOptions: boolean; additionalPackages?: string[] },
474480
): Promise<PythonEnvironment | undefined> {
475481
const sortedEnvs = ensureGlobalEnv(basePythons, log);
476-
const project = api.getPythonProject(venvRoot);
477482

478483
let customize: boolean | undefined = true;
479484
if (options.showQuickAndCustomOptions) {
@@ -483,26 +488,11 @@ export async function createPythonVenv(
483488
if (customize === undefined) {
484489
return;
485490
} else if (customize === false) {
486-
sendTelemetryEvent(EventNames.VENV_CREATION, undefined, { creationType: 'quick' });
487-
const installables = await getProjectInstallable(api, project ? [project] : undefined);
488-
const allPackages = [];
489-
allPackages.push(...(installables?.flatMap((i) => i.args ?? []) ?? []));
490-
if (options.additionalPackages) {
491-
allPackages.push(...options.additionalPackages);
492-
}
493-
return await createWithProgress(
494-
nativeFinder,
495-
api,
496-
log,
497-
manager,
498-
sortedEnvs[0],
499-
venvRoot,
500-
path.join(venvRoot.fsPath, '.venv'),
501-
{ install: allPackages, uninstall: [] },
502-
);
491+
return quickCreateVenv(nativeFinder, api, log, manager, sortedEnvs[0], venvRoot, options.additionalPackages);
503492
} else {
504493
sendTelemetryEvent(EventNames.VENV_CREATION, undefined, { creationType: 'custom' });
505494
}
495+
const project = api.getPythonProject(venvRoot);
506496

507497
const basePython = await pickEnvironmentFrom(sortedEnvs);
508498
if (!basePython || !basePython.execInfo) {

src/managers/poetry/poetryManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import { Disposable, EventEmitter, MarkdownString, ProgressLocation, ThemeIcon, Uri } from 'vscode';
2+
import { Disposable, EventEmitter, MarkdownString, ProgressLocation, Uri } from 'vscode';
33
import {
44
DidChangeEnvironmentEventArgs,
55
DidChangeEnvironmentsEventArgs,
@@ -49,7 +49,6 @@ export class PoetryManager implements EnvironmentManager, Disposable {
4949
this.displayName = 'Poetry';
5050
this.preferredPackageManagerId = 'ms-python.python:poetry';
5151
this.tooltip = new MarkdownString(PoetryStrings.poetryManager, true);
52-
this.iconPath = new ThemeIcon('python');
5352
}
5453

5554
name: string;

0 commit comments

Comments
 (0)