Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use python3 as the Python path within containers #2476

Merged
merged 16 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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