Skip to content

Commit

Permalink
Remove more usage instances of sysPrefix (#15103)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Feb 1, 2024
1 parent 606b065 commit aaf4e71
Show file tree
Hide file tree
Showing 40 changed files with 108 additions and 240 deletions.
1 change: 0 additions & 1 deletion src/api.unstable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ declare module './api' {
displayName?: string;
uri: Uri;
version?: PythonVersion;
sysPrefix: string;
envType?: EnvironmentType;
envName?: string;
envPath?: Uri;
Expand Down
4 changes: 1 addition & 3 deletions src/kernels/errors/kernelErrorHandler.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ suite('Error Handler Unit Tests', () => {
const jupyterInterpreter: PythonEnvironment = {
displayName: 'Hello',
uri: Uri.file('Some Path'),
id: Uri.file('Some Path').fsPath,
sysPrefix: ''
id: Uri.file('Some Path').fsPath
};
let disposables: IDisposable[] = [];
let environments: PythonExtension['environments'];
Expand Down Expand Up @@ -181,7 +180,6 @@ suite('Error Handler Unit Tests', () => {
interpreter: {
uri: Uri.file('Hello There'),
id: Uri.file('Hello There').fsPath,
sysPrefix: 'Something else',
displayName: 'Hello (Some Path)'
},
kernelSpec: {
Expand Down
2 changes: 0 additions & 2 deletions src/kernels/execution/helpers.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ suite(`UpdateNotebookMetadata`, () => {
const python36Global: PythonEnvironment = {
uri: Uri.file('/usr/bin/python36'),
id: Uri.file('/usr/bin/python36').fsPath,
sysPrefix: '/usr',
displayName: 'Python 3.6',
envType: EnvironmentType.Unknown
};
Expand All @@ -33,7 +32,6 @@ suite(`UpdateNotebookMetadata`, () => {
const python37Global: PythonEnvironment = {
uri: Uri.file('/usr/bin/python37'),
id: Uri.file('/usr/bin/python37').fsPath,
sysPrefix: '/usr',
displayName: 'Python 3.7',
envType: EnvironmentType.Unknown
};
Expand Down
20 changes: 1 addition & 19 deletions src/kernels/helpers.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ suite('Kernel Connection Helpers', () => {
},
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix'
id: Uri.file('pyPath').fsPath
}
})
);
Expand All @@ -116,7 +115,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envType: EnvironmentType.Unknown
}
})
Expand All @@ -136,7 +134,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something',
envType: EnvironmentType.Pipenv
Expand All @@ -158,7 +155,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something 64-bit',
envType: EnvironmentType.Pipenv
Expand All @@ -180,7 +176,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '.env',
displayName: 'Something',
envType: EnvironmentType.Conda
Expand All @@ -202,7 +197,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '.env',
displayName: 'Something 64-bit',
envType: EnvironmentType.Conda
Expand Down Expand Up @@ -243,7 +237,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '.env',
displayName: 'Something 64-bit'
}
Expand All @@ -265,7 +258,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '.env',
displayName: 'Something 64-bit',
envType: EnvironmentType.Unknown
Expand All @@ -288,7 +280,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something',
envType: EnvironmentType.Pipenv
Expand All @@ -311,7 +302,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something 64-bit',
envType: EnvironmentType.Pipenv
Expand All @@ -334,7 +324,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something 64-bit',
envType: EnvironmentType.Conda
Expand Down Expand Up @@ -369,7 +358,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '.env',
displayName: 'Something 64-bit',
envType: EnvironmentType.Conda
Expand Down Expand Up @@ -404,7 +392,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '.env',
displayName: 'Something 64-bit',
envType: EnvironmentType.Conda
Expand All @@ -429,7 +416,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something 64-bit'
}
Expand All @@ -451,7 +437,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something 64-bit',
envType: EnvironmentType.Unknown
Expand Down Expand Up @@ -486,7 +471,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something 64-bit',
envType: EnvironmentType.Unknown
Expand All @@ -509,7 +493,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something',
envType: EnvironmentType.Pipenv
Expand All @@ -532,7 +515,6 @@ suite('Kernel Connection Helpers', () => {
interpreter: {
uri: Uri.file('pyPath'),
id: Uri.file('pyPath').fsPath,
sysPrefix: 'sysPrefix',
envName: '',
displayName: 'Something 64-bit',
envType: EnvironmentType.Pipenv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ suite('Jupyter Interpreter Configuration', () => {
let command: IJupyterCommand;
const pythonInterpreter: PythonEnvironment = {
uri: Uri.file(''),
id: Uri.file('').fsPath,
sysPrefix: ''
id: Uri.file('').fsPath
};
let disposables: Disposable[] = [];
setup(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ suite('Jupyter Interpreter Service', () => {
const selectedJupyterInterpreter = createPythonInterpreter({ displayName: 'JupyterInterpreter' });
const pythonInterpreter: PythonEnvironment = {
uri: Uri.file('some path'),
id: Uri.file('some path').fsPath,
sysPrefix: ''
id: Uri.file('some path').fsPath
};
const secondPythonInterpreter: PythonEnvironment = {
uri: Uri.file('second interpreter path'),
id: Uri.file('second interpreter path').fsPath,
sysPrefix: ''
id: Uri.file('second interpreter path').fsPath
};
let disposables: IDisposable[] = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ suite('Jupyter Server Provider', () => {
let interpreterService: IInterpreterService;
const workingPython: PythonEnvironment = {
uri: Uri.file('/foo/bar/python.exe'),
id: Uri.file('/foo/bar/python.exe').fsPath,
sysPrefix: 'Python'
id: Uri.file('/foo/bar/python.exe').fsPath
};
let disposables: Disposable[] = [];
let source: CancellationTokenSource;
Expand Down
39 changes: 10 additions & 29 deletions src/kernels/jupyter/session/jupyterKernelService.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ suite('JupyterKernelService', () => {
interpreter: {
id: '/usr/bin/python3',
displayName: 'Python 3 Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3'),
sysPrefix: 'python'
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3')
},
id: '0'
}),
Expand All @@ -92,7 +91,6 @@ suite('JupyterKernelService', () => {
id: '/usr/bin/conda/python3',
displayName: 'Conda Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/conda/python3.exe' : '/usr/bin/conda/python3'),
sysPrefix: 'conda',
envType: EnvironmentType.Conda
},
id: '1'
Expand All @@ -115,16 +113,14 @@ suite('JupyterKernelService', () => {
interpreter: {
displayName: 'Python 3 Environment',
path: os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3',
sysPrefix: 'python',
version: { major: 3, minor: 8, raw: '3.8', patch: 0 }
}
}
},
interpreter: {
id: '/usr/bin/python3',
displayName: 'Python 3 Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3'),
sysPrefix: 'python'
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3')
},
id: '2'
}),
Expand Down Expand Up @@ -157,8 +153,7 @@ suite('JupyterKernelService', () => {
interpreter: {
id: '/usr/bin/python',
displayName: 'Python 2 Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python.exe' : '/usr/bin/python'),
sysPrefix: 'python'
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python.exe' : '/usr/bin/python')
},
id: '4'
}),
Expand All @@ -180,16 +175,14 @@ suite('JupyterKernelService', () => {
interpreter: {
displayName: 'Python 3 Environment',
path: os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3',
sysPrefix: 'python',
version: { major: 3, minor: 8, raw: '3.8', patch: 0 }
}
}
},
interpreter: {
id: '/usr/bin/python3',
displayName: 'Python 3 Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3'),
sysPrefix: 'python'
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3')
},
id: '5'
}),
Expand Down Expand Up @@ -222,8 +215,7 @@ suite('JupyterKernelService', () => {
interpreter: {
id: '/usr/bin/python',
displayName: 'Python 2 Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python.exe' : '/usr/bin/python'),
sysPrefix: 'python'
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python.exe' : '/usr/bin/python')
},
id: '7'
}),
Expand All @@ -245,16 +237,14 @@ suite('JupyterKernelService', () => {
interpreter: {
displayName: 'Python 3 Environment',
path: os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3',
sysPrefix: 'python',
version: { major: 3, minor: 8, raw: '3.8', patch: 0 }
}
}
},
interpreter: {
id: '/usr/bin/python3',
displayName: 'Python 3 Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3'),
sysPrefix: 'python'
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python3.exe' : '/usr/bin/python3')
},
id: '8'
}),
Expand Down Expand Up @@ -287,8 +277,7 @@ suite('JupyterKernelService', () => {
interpreter: {
id: '/usr/bin/python',
displayName: 'Python 2 Environment',
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python.exe' : '/usr/bin/python'),
sysPrefix: 'python'
uri: Uri.file(os.platform() === 'win32' ? '/usr/bin/python.exe' : '/usr/bin/python')
},
id: '10'
}),
Expand All @@ -310,7 +299,6 @@ suite('JupyterKernelService', () => {
interpreter: {
displayName: 'Conda base environment',
path: '/usr/conda/envs/base/python',
sysPrefix: 'conda',
envType: EnvironmentType.Conda
}
},
Expand All @@ -324,7 +312,6 @@ suite('JupyterKernelService', () => {
uri: Uri.file(
os.platform() === 'win32' ? '/usr/conda/envs/base/python.exe' : '/usr/conda/envs/base/python'
),
sysPrefix: 'conda',
envType: EnvironmentType.Conda
},
id: '11'
Expand Down Expand Up @@ -355,7 +342,6 @@ suite('JupyterKernelService', () => {
os.platform() === 'win32'
? '/usr/don/home/envs/sample/bin/python.exe'
: '/usr/don/home/envs/sample/bin/python',
sysPrefix: 'python',
version: { major: 3, minor: 8, raw: '3.8', patch: 0 }
}
},
Expand All @@ -370,8 +356,7 @@ suite('JupyterKernelService', () => {
os.platform() === 'win32'
? '/usr/don/home/envs/sample/bin/python.exe'
: '/usr/don/home/envs/sample/bin/python'
),
sysPrefix: 'python'
)
},
id: '12'
}),
Expand All @@ -393,7 +378,6 @@ suite('JupyterKernelService', () => {
os.platform() === 'win32'
? '/usr/don/home/envs/sample/bin/python.exe'
: '/usr/don/home/envs/sample/bin/python',
sysPrefix: 'python',
version: { major: 3, minor: 8, raw: '3.8', patch: 0 }
}
},
Expand All @@ -408,8 +392,7 @@ suite('JupyterKernelService', () => {
os.platform() === 'win32'
? '/usr/don/home/envs/sample/bin/python.exe'
: '/usr/don/home/envs/sample/bin/python'
),
sysPrefix: 'python'
)
},
id: '13'
}),
Expand All @@ -428,7 +411,6 @@ suite('JupyterKernelService', () => {
os.platform() === 'win32'
? '/usr/don/home/envs/sample/bin/python.exe'
: '/usr/don/home/envs/sample/bin/python',
sysPrefix: 'python',
version: { major: 3, minor: 8, raw: '3.8', patch: 0 }
}
},
Expand All @@ -443,8 +425,7 @@ suite('JupyterKernelService', () => {
os.platform() === 'win32'
? '/usr/don/home/envs/sample/bin/python.exe'
: '/usr/don/home/envs/sample/bin/python'
),
sysPrefix: 'python'
)
},
id: '14'
})
Expand Down
Loading

0 comments on commit aaf4e71

Please sign in to comment.