Skip to content

Commit 2b24b88

Browse files
committed
Merge branch 'remove-pylance-client2' of https://github.com/bschnurr/vscode-python into remove-pylance-client2
2 parents db9e2a4 + a39f03f commit 2b24b88

File tree

5 files changed

+53
-29
lines changed

5 files changed

+53
-29
lines changed

build/azure-pipeline.stable.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ extends:
9292
displayName: Build
9393

9494
- bash: |
95-
mkdir -p $(Build.SourcesDirectory)/python-env-tools/bin
96-
chmod +x $(Build.SourcesDirectory)/python-env-tools/bin
95+
mkdir -p $(Build.SourcesDirectory)/python-env-tools/bin
96+
chmod +x $(Build.SourcesDirectory)/python-env-tools/bin
9797
displayName: Make Directory for python-env-tool binary
9898
9999
- bash: |
@@ -124,30 +124,30 @@ extends:
124124
125125
- task: DownloadPipelineArtifact@2
126126
inputs:
127-
buildType: 'specific'
128-
project: 'Monaco'
129-
definition: 593
130-
buildVersionToDownload: 'latestFromBranch'
131-
branchName: 'refs/heads/release/2025.10'
132-
targetPath: '$(Build.SourcesDirectory)/python-env-tools/bin'
133-
artifactName: 'bin-$(buildTarget)'
134-
itemPattern: |
135-
pet.exe
136-
pet
137-
ThirdPartyNotices.txt
127+
buildType: 'specific'
128+
project: 'Monaco'
129+
definition: 593
130+
buildVersionToDownload: 'latestFromBranch'
131+
branchName: 'refs/heads/release/2025.12'
132+
targetPath: '$(Build.SourcesDirectory)/python-env-tools/bin'
133+
artifactName: 'bin-$(buildTarget)'
134+
itemPattern: |
135+
pet.exe
136+
pet
137+
ThirdPartyNotices.txt
138138
139139
- bash: |
140-
ls -lf ./python-env-tools/bin
141-
chmod +x ./python-env-tools/bin/pet*
142-
ls -lf ./python-env-tools/bin
140+
ls -lf ./python-env-tools/bin
141+
chmod +x ./python-env-tools/bin/pet*
142+
ls -lf ./python-env-tools/bin
143143
displayName: Set chmod for pet binary
144144
145145
- script: python -c "import shutil; shutil.rmtree('.nox', ignore_errors=True)"
146146
displayName: Clean up Nox
147147
tsa:
148-
config:
149-
areaPath: 'Visual Studio Code Python Extensions'
150-
serviceTreeID: '6e6194bc-7baa-4486-86d0-9f5419626d46'
151-
enabled: true
148+
config:
149+
areaPath: 'Visual Studio Code Python Extensions'
150+
serviceTreeID: '6e6194bc-7baa-4486-86d0-9f5419626d46'
151+
enabled: true
152152
apiScanDependentPipelineId: '593' # python-environment-tools
153153
apiScanSoftwareVersion: '2024'

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python",
33
"displayName": "Python",
44
"description": "Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more.",
5-
"version": "2025.11.0-dev",
5+
"version": "2025.13.0-dev",
66
"featureFlags": {
77
"usingNewInterpreterStorage": true
88
},
@@ -83,7 +83,8 @@
8383
"onLanguageModelTool:get_python_executable_details",
8484
"onLanguageModelTool:install_python_packages",
8585
"onLanguageModelTool:configure_python_environment",
86-
"onLanguageModelTool:create_virtual_environment"
86+
"onLanguageModelTool:create_virtual_environment",
87+
"onTerminalShellIntegration:python"
8788
],
8889
"main": "./out/client/extension",
8990
"browser": "./dist/extension.browser.js",
@@ -640,7 +641,7 @@
640641
"type": "array"
641642
},
642643
"python.terminal.shellIntegration.enabled": {
643-
"default": false,
644+
"default": true,
644645
"markdownDescription": "%python.terminal.shellIntegration.enabled.description%",
645646
"scope": "resource",
646647
"type": "boolean",

src/client/common/terminal/environmentActivationProviders/condaActivationProvider.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import '../../extensions';
88
import { inject, injectable } from 'inversify';
99
import * as path from 'path';
1010
import { Uri } from 'vscode';
11+
import { traceInfo, traceVerbose, traceWarn } from '../../../logging';
1112

1213
import { IComponentAdapter, ICondaService } from '../../../interpreter/contracts';
1314
import { IPlatformService } from '../../platform/types';
@@ -53,28 +54,36 @@ export class CondaActivationCommandProvider implements ITerminalActivationComman
5354
pythonPath: string,
5455
targetShell: TerminalShellType,
5556
): Promise<string[] | undefined> {
57+
traceVerbose(`Getting conda activation commands for interpreter ${pythonPath} with shell ${targetShell}`);
5658
const envInfo = await this.pyenvs.getCondaEnvironment(pythonPath);
5759
if (!envInfo) {
60+
traceWarn(`No conda environment found for interpreter ${pythonPath}`);
5861
return undefined;
5962
}
63+
traceVerbose(`Found conda environment: ${JSON.stringify(envInfo)}`);
6064

6165
const condaEnv = envInfo.name.length > 0 ? envInfo.name : envInfo.path;
6266

6367
// New version.
6468
const interpreterPath = await this.condaService.getInterpreterPathForEnvironment(envInfo);
69+
traceInfo(`Using interpreter path: ${interpreterPath}`);
6570
const activatePath = await this.condaService.getActivationScriptFromInterpreter(interpreterPath, envInfo.name);
71+
traceVerbose(`Got activation script: ${activatePath?.path}} with type: ${activatePath?.type}`);
6672
// eslint-disable-next-line camelcase
6773
if (activatePath?.path) {
6874
if (
6975
this.platform.isWindows &&
7076
targetShell !== TerminalShellType.bash &&
7177
targetShell !== TerminalShellType.gitbash
7278
) {
73-
return [activatePath.path, `conda activate ${condaEnv.toCommandArgumentForPythonExt()}`];
79+
const commands = [activatePath.path, `conda activate ${condaEnv.toCommandArgumentForPythonExt()}`];
80+
traceInfo(`Using Windows-specific commands: ${commands.join(', ')}`);
81+
return commands;
7482
}
7583

7684
const condaInfo = await this.condaService.getCondaInfo();
7785

86+
traceVerbose(`Conda shell level: ${condaInfo?.conda_shlvl}`);
7887
if (
7988
activatePath.type !== 'global' ||
8089
// eslint-disable-next-line camelcase
@@ -84,27 +93,36 @@ export class CondaActivationCommandProvider implements ITerminalActivationComman
8493
// activatePath is not the global activate path, or we don't have a shlvl, or it's -1(conda never sourced).
8594
// and we need to source the activate path.
8695
if (activatePath.path === 'activate') {
87-
return [
96+
const commands = [
8897
`source ${activatePath.path}`,
8998
`conda activate ${condaEnv.toCommandArgumentForPythonExt()}`,
9099
];
100+
traceInfo(`Using source activate commands: ${commands.join(', ')}`);
101+
return commands;
91102
}
92-
return [`source ${activatePath.path} ${condaEnv.toCommandArgumentForPythonExt()}`];
103+
const command = [`source ${activatePath.path} ${condaEnv.toCommandArgumentForPythonExt()}`];
104+
traceInfo(`Using single source command: ${command}`);
105+
return command;
93106
}
94-
return [`conda activate ${condaEnv.toCommandArgumentForPythonExt()}`];
107+
const command = [`conda activate ${condaEnv.toCommandArgumentForPythonExt()}`];
108+
traceInfo(`Using direct conda activate command: ${command}`);
109+
return command;
95110
}
96111

97112
switch (targetShell) {
98113
case TerminalShellType.powershell:
99114
case TerminalShellType.powershellCore:
115+
traceVerbose('Using PowerShell-specific activation');
100116
return _getPowershellCommands(condaEnv);
101117

102118
// TODO: Do we really special-case fish on Windows?
103119
case TerminalShellType.fish:
120+
traceVerbose('Using Fish shell-specific activation');
104121
return getFishCommands(condaEnv, await this.condaService.getCondaFile());
105122

106123
default:
107124
if (this.platform.isWindows) {
125+
traceVerbose('Using Windows shell-specific activation fallback option.');
108126
return this.getWindowsCommands(condaEnv);
109127
}
110128
return getUnixCommands(condaEnv, await this.condaService.getCondaFile());

src/client/pythonEnvironments/common/environmentManagers/condaService.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { inject, injectable } from 'inversify';
22
import * as path from 'path';
33
import { SemVer } from 'semver';
44
import { IFileSystem, IPlatformService } from '../../../common/platform/types';
5+
import { traceVerbose } from '../../../logging';
56
import { cache } from '../../../common/utils/decorators';
67
import { ICondaService } from '../../../interpreter/contracts';
78
import { traceDecoratorVerbose } from '../../../logging';
@@ -23,12 +24,15 @@ export class CondaService implements ICondaService {
2324
interpreterPath?: string,
2425
envName?: string,
2526
): Promise<{ path: string | undefined; type: 'local' | 'global' } | undefined> {
27+
traceVerbose(`Getting activation script for interpreter ${interpreterPath}, env ${envName}`);
2628
const condaPath = await this.getCondaFileFromInterpreter(interpreterPath, envName);
29+
traceVerbose(`Found conda path: ${condaPath}`);
2730

2831
const activatePath = (condaPath
2932
? path.join(path.dirname(condaPath), 'activate')
3033
: 'activate'
3134
).fileToCommandArgumentForPythonExt(); // maybe global activate?
35+
traceVerbose(`Using activate path: ${activatePath}`);
3236

3337
// try to find the activate script in the global conda root prefix.
3438
if (this.platform.isLinux || this.platform.isMac) {
@@ -41,6 +45,7 @@ export class CondaService implements ICondaService {
4145
.fileToCommandArgumentForPythonExt();
4246

4347
if (activatePath === globalActivatePath || !(await this.fileSystem.fileExists(activatePath))) {
48+
traceVerbose(`Using global activate path: ${globalActivatePath}`);
4449
return {
4550
path: globalActivatePath,
4651
type: 'global',

0 commit comments

Comments
 (0)