opendatahub-io-contrib / workbench-images

Various custom Workbenches and Runtimes for Open Data Hub and OpenShift Data Science
MIT License
35 stars 23 forks source link

Add default Python interpreter to VSCode #55

Open guimou opened 1 month ago

guimou commented 1 month ago

Example, add this to the launcher, with pre-check if files exist:

 #!/usr/bin/env bash

mkdir -p ${HOME}/.local/share/code-server/User
cat <<EOF > ${HOME}/.local/share/code-server/User/settings.json
{
  "python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}
EOF

mkdir -p ${HOME}/.vscode
cat <<EOF > ${HOME}/.vscode/settings.json
{
  "python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}
EOF

# VSCode Entrypoint
. /opt/app-root/bin/run-code-server.sh
shalberd commented 1 month ago

correct, see also the other user's question in #41 and my comment: https://github.com/opendatahub-io-contrib/workbench-images/issues/41#issuecomment-1971905384