Skip to content

Commit 877861c

Browse files
author
Kartik Raj
authored
Remove python.disableInstallationCheck setting (#19245)
Remove python.disableInstallationCheck setting
1 parent d7204ca commit 877861c

10 files changed

Lines changed: 2 additions & 74 deletions

File tree

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,6 @@
405405
"scope": "application",
406406
"type": "boolean"
407407
},
408-
"python.disableInstallationCheck": {
409-
"default": false,
410-
"description": "Whether to check if Python is installed (also warn when using the macOS-installed Python).",
411-
"scope": "resource",
412-
"type": "boolean"
413-
},
414408
"python.envFile": {
415409
"default": "${workspaceFolder}/.env",
416410
"description": "Absolute path to a file containing environment variable definitions.",

resources/report_issue_user_settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"pipenvPath": "placeholder",
1212
"poetryPath": "placeholder",
1313
"devOptions": false,
14-
"disableInstallationChecks": false,
1514
"globalModuleInstallation": false,
1615
"languageServer": true,
1716
"languageServerIsDefault": false,

src/client/application/diagnostics/checks/macPythonInterpreter.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ export class InvalidMacPythonInterpreterService extends BaseDiagnosticsService {
6868
}
6969
const configurationService = this.serviceContainer.get<IConfigurationService>(IConfigurationService);
7070
const settings = configurationService.getSettings(resource);
71-
if (settings.disableInstallationChecks === true) {
72-
return [];
73-
}
7471
if (!(await this.helper.isMacDefaultPythonPath(settings.pythonPath))) {
7572
return [];
7673
}

src/client/application/diagnostics/checks/pythonInterpreter.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { inject, injectable } from 'inversify';
66
import { DiagnosticSeverity } from 'vscode';
77
import '../../../common/extensions';
88
import * as nls from 'vscode-nls';
9-
import { IConfigurationService, IDisposableRegistry, Resource } from '../../../common/types';
9+
import { IDisposableRegistry, Resource } from '../../../common/types';
1010
import { IInterpreterService } from '../../../interpreter/contracts';
1111
import { IServiceContainer } from '../../../ioc/types';
1212
import { sendTelemetryEvent } from '../../../telemetry';
@@ -67,12 +67,6 @@ export class InvalidPythonInterpreterService extends BaseDiagnosticsService {
6767
}
6868

6969
public async diagnose(resource: Resource): Promise<IDiagnostic[]> {
70-
const configurationService = this.serviceContainer.get<IConfigurationService>(IConfigurationService);
71-
const settings = configurationService.getSettings(resource);
72-
if (settings.disableInstallationChecks === true) {
73-
return [];
74-
}
75-
7670
const interpreterService = this.serviceContainer.get<IInterpreterService>(IInterpreterService);
7771
const hasInterpreters = await interpreterService.hasInterpreters();
7872

src/client/common/configSettings.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ export class PythonSettings implements IPythonSettings {
112112

113113
public sortImports!: ISortImportSettings;
114114

115-
public disableInstallationChecks = false;
116-
117115
public globalModuleInstallation = false;
118116

119117
public pylanceLspNotebooksEnabled = false;
@@ -294,7 +292,6 @@ export class PythonSettings implements IPythonSettings {
294292
this.linting = lintingSettings;
295293
}
296294

297-
this.disableInstallationChecks = pythonSettings.get<boolean>('disableInstallationCheck') === true;
298295
this.globalModuleInstallation = pythonSettings.get<boolean>('globalModuleInstallation') === true;
299296
this.pylanceLspNotebooksEnabled = pythonSettings.get<boolean>('pylanceLspNotebooksEnabled') === true;
300297

src/client/common/process/internal/python.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ export function execModule(name: string, moduleArgs: string[]): string[] {
2727
return args;
2828
}
2929

30-
export function getSysPrefix(): [string[], (out: string) => string] {
31-
const args = ['-c', 'import sys;print(sys.prefix)'];
32-
33-
function parse(out: string): string {
34-
return out.trim();
35-
}
36-
37-
return [args, parse];
38-
}
39-
4030
export function getExecutable(): [string[], (out: string) => string] {
4131
const args = ['-c', 'import sys;print(sys.executable)'];
4232

src/client/common/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ export interface IPythonSettings {
188188
readonly terminal: ITerminalSettings;
189189
readonly sortImports: ISortImportSettings;
190190
readonly envFile: string;
191-
readonly disableInstallationChecks: boolean;
192191
readonly globalModuleInstallation: boolean;
193192
readonly pylanceLspNotebooksEnabled: boolean;
194193
readonly onDidChange: Event<void>;

src/test/application/diagnostics/checks/macPythonInterpreter.unit.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,7 @@ suite('Application Diagnostics - Checks Mac Python Interpreter', () => {
144144
expect(diagnostics).to.be.deep.equal([]);
145145
platformService.verifyAll();
146146
});
147-
test('Should return empty diagnostics if installer check is disabled', async () => {
148-
settings
149-
.setup((s) => s.disableInstallationChecks)
150-
.returns(() => true)
151-
.verifiable(typemoq.Times.once());
152-
153-
const diagnostics = await diagnosticService.diagnose(undefined);
154-
expect(diagnostics).to.be.deep.equal([]);
155-
settings.verifyAll();
156-
platformService.verifyAll();
157-
});
158147
test('Should return empty diagnostics if platform is mac and selected interpreter is not default mac interpreter', async () => {
159-
settings
160-
.setup((s) => s.disableInstallationChecks)
161-
.returns(() => false)
162-
.verifiable(typemoq.Times.once());
163148
platformService
164149
.setup((i) => i.isMac)
165150
.returns(() => true)
@@ -176,11 +161,6 @@ suite('Application Diagnostics - Checks Mac Python Interpreter', () => {
176161
helper.verifyAll();
177162
});
178163
test('Should return diagnostic if platform is mac and selected interpreter is default mac interpreter', async () => {
179-
settings
180-
.setup((s) => s.disableInstallationChecks)
181-
.returns(() => false)
182-
.verifiable(typemoq.Times.once());
183-
184164
platformService
185165
.setup((i) => i.isMac)
186166
.returns(() => true)

src/test/application/diagnostics/checks/pythonInterpreter.unit.test.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,7 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
118118
expect(canHandle).to.be.equal(false, 'Invalid value');
119119
diagnostic.verifyAll();
120120
});
121-
test('Should return empty diagnostics if installer check is disabled', async () => {
122-
settings
123-
.setup((s) => s.disableInstallationChecks)
124-
.returns(() => true)
125-
.verifiable(typemoq.Times.once());
126-
127-
const diagnostics = await diagnosticService.diagnose(undefined);
128-
expect(diagnostics).to.be.deep.equal([]);
129-
settings.verifyAll();
130-
});
131121
test('Should return diagnostics if there are no interpreters after double-checking', async () => {
132-
settings
133-
.setup((s) => s.disableInstallationChecks)
134-
.returns(() => false)
135-
.verifiable(typemoq.Times.once());
136122
interpreterService
137123
.setup((i) => i.hasInterpreters())
138124
.returns(() => Promise.resolve(false))
@@ -149,10 +135,6 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
149135
);
150136
});
151137
test('Should return invalid diagnostics if there are interpreters but no current interpreter', async () => {
152-
settings
153-
.setup((s) => s.disableInstallationChecks)
154-
.returns(() => false)
155-
.verifiable(typemoq.Times.once());
156138
interpreterService
157139
.setup((i) => i.hasInterpreters())
158140
.returns(() => Promise.resolve(true))
@@ -178,10 +160,6 @@ suite('Application Diagnostics - Checks Python Interpreter', () => {
178160
interpreterService.verifyAll();
179161
});
180162
test('Should return empty diagnostics if there are interpreters and a current interpreter', async () => {
181-
settings
182-
.setup((s) => s.disableInstallationChecks)
183-
.returns(() => false)
184-
.verifiable(typemoq.Times.once());
185163
interpreterService
186164
.setup((i) => i.hasInterpreters())
187165
.returns(() => Promise.resolve(true))

src/test/common/configSettings/configSettings.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ suite('Python Settings', async () => {
9494
}
9595

9696
// boolean settings
97-
for (const name of ['disableInstallationCheck', 'globalModuleInstallation']) {
97+
for (const name of ['globalModuleInstallation']) {
9898
config
9999
.setup((c) => c.get<boolean>(name))
100100

0 commit comments

Comments
 (0)