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

Fix problem with other kernels that use python being picked. #5628

Merged
merged 1 commit into from May 14, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,34 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM node:8

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1

# Verify git and needed tools are installed
RUN apt-get install -y git procps

# Remove outdated yarn from /opt and install via package
# so it can be easily updated via apt-get upgrade yarn
RUN rm -rf /opt/yarn-* \
&& rm -f /usr/local/bin/yarn \
&& rm -f /usr/local/bin/yarnpkg \
&& apt-get install -y curl apt-transport-https lsb-release \
&& curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2>/dev/null \
&& echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get -y install --no-install-recommends yarn

# Install tslint and typescript
RUN npm install -g tslint typescript

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,8 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": "Node.js 8 & TypeScript",
"dockerFile": "Dockerfile",
"extensions": [
"ms-vscode.vscode-typescript-tslint-plugin"
]
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Expand Up @@ -2,6 +2,22 @@
{
"version": "0.1.0",
"configurations": [
{
"name": "Extension inside container",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/data"
],
"stopOnEntry": false,
"smartStep": true,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*"
],
"preLaunchTask": "Compile"
},
{
"name": "Python: Current File with iPython",
"type": "python",
Expand Down
3 changes: 3 additions & 0 deletions data/.vscode/settings.json
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/bin/python3"
}
21,492 changes: 21,492 additions & 0 deletions data/get-pip.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions data/test.py
@@ -0,0 +1,2 @@
#%%
print('hello')
1 change: 1 addition & 0 deletions news/2 Fixes/5586.md
@@ -0,0 +1 @@
Fix problems if other language kernels are installed that are using python under the covers (bash is one such example).
11 changes: 10 additions & 1 deletion package-lock.json

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

11 changes: 7 additions & 4 deletions src/client/datascience/jupyter/jupyterExecution.ts
Expand Up @@ -590,14 +590,17 @@ export class JupyterExecutionBase implements IJupyterExecution {
const spec = specs[i];
let score = 0;

if (spec && spec.path && spec.path.length > 0 && info && spec.path === info.path) {
// Path match
score += 10;
}
// First match on language. No point if not python.
if (spec && spec.language && spec.language.toLocaleLowerCase() === 'python') {
// Language match
score += 1;

// See if the path matches. Don't bother if the language doesn't.
if (spec && spec.path && spec.path.length > 0 && info && spec.path === info.path) {
// Path match
score += 10;
}

// See if the version is the same
if (info && info.version && specDetails[i]) {
const details = specDetails[i];
Expand Down