Skip to content

Commit

Permalink
Use python3 as the Python path within containers (#2476)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored Nov 23, 2020
1 parent a77b643 commit 31956c8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.8.1 - 23 November 2020
### Fixed
* This update fixes an issue that prevented debugging Python applications in Docker containers. The latest version of the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) is also required. [#2455](https://github.com/microsoft/vscode-docker/issues/2455)
* Fixed an issue where the logo was hard to see in the [extension gallery page](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) in the browser. [#2499](https://github.com/microsoft/vscode-docker/issues/2499)

## 1.8.0 - 16 November 2020
### Added
* Added a read-only file explorer for running containers, this can be seen in the Docker Explorer tab. [#2333](https://github.com/microsoft/vscode-docker/issues/2333)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "vscode-docker",
"version": "1.8.0",
"version": "1.8.1",
"publisher": "ms-azuretools",
"displayName": "Docker",
"description": "Makes it easy to create, manage, and debug containerized applications.",
"license": "SEE LICENSE IN LICENSE.md",
"icon": "resources/docker_blue.png",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"galleryBanner": {
"color": "#1289B9",
"color": "#1e1e1e",
"theme": "dark"
},
"categories": [
Expand Down
18 changes: 17 additions & 1 deletion src/debugging/python/PythonDebugHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,23 @@ export class PythonDebugHelper implements DebugHelper {
program: debugConfiguration.file || pythonRunTaskOptions.file,
redirectOutput: debugConfiguration.redirectOutput || true,
args: args,
cwd: '.'
cwd: '.',

/* eslint-disable no-template-curly-in-string */
// These settings control what Python interpreter gets used in what circumstance.
// debugAdapterPython controls the interpreter used by the Python extension to start the debug adapter, on the local client
// We want it to use what it would normally use for local Python debugging, i.e. the chosen local interpreter
debugAdapterPython: '${command:python.interpreterPath}',

// debugLauncherPython controls the interpreter used by the debug adapter to start the launcher, also on the local client
// We want it to use what it would normally use for local Python debugging, i.e. the chosen local interpreter
// This actually launches our launcher in resources/python/launcher.py, which uses `docker exec -d <containerId> python3 /debugpy/launcher ...` to launch the real debugpy launcher in the container
debugLauncherPython: '${command:python.interpreterPath}',
/* eslint-enable no-template-curly-in-string */

// python controls the interpreter used by the launcher to start the application itself
// Since this is in the container it should always use `python3`
python: 'python3',
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/docker/ContextManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class DockerContextManager implements ContextManager, Disposable {

try {
if (isNewContextType(currentContext.ContextType)) {
actionContext.telemetry.properties.hostProtocol = currentContext.ContextType
actionContext.telemetry.properties.hostProtocol = currentContext.ContextType;
} else {
actionContext.telemetry.properties.hostProtocol = new URL(currentContext.DockerEndpoint).protocol;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/python/PythonExtensionHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export namespace PythonExtensionHelper {

export async function getPythonExtension(): Promise<vscode.Extension<PythonExtensionAPI>> | undefined {
const pyExtensionId = 'ms-python.python';
const minPyExtensionVersion = new semver.SemVer('2020.5.78807');
const minPyExtensionVersion = new semver.SemVer('2020.11.367453362');

const pyExt = vscode.extensions.getExtension(pyExtensionId);
const button = localize('vscode-docker.tasks.pythonExt.openExtension', 'Open Extension');
Expand Down

0 comments on commit 31956c8

Please sign in to comment.