diff options
-rw-r--r-- | src/python/devcontainer-feature.json | 2 | ||||
-rwxr-xr-x | src/python/install.sh | 2 | ||||
-rw-r--r-- | test/python/install_additional_jupyterlab.sh | 23 | ||||
-rw-r--r-- | test/python/install_jupyterlab.sh | 15 | ||||
-rw-r--r-- | test/python/scenarios.json | 17 |
5 files changed, 50 insertions, 9 deletions
diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index 6d28941..0c90e0b 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "python", - "version": "1.0.7", + "version": "1.0.8", "name": "Python", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/python", "description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.", diff --git a/src/python/install.sh b/src/python/install.sh index 2a0dd55..3cf3a88 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -374,6 +374,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then # Additional python versions to be installed but not be set as default. if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then + OLD_INSTALL_PATH="${INSTALL_PATH}" OLDIFS=$IFS IFS="," read -a additional_versions <<< "$ADDITIONAL_VERSIONS" @@ -381,6 +382,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then OVERRIDE_DEFAULT_VERSION="false" install_python $version done + INSTALL_PATH="${OLD_INSTALL_PATH}" IFS=$OLDIFS fi diff --git a/test/python/install_additional_jupyterlab.sh b/test/python/install_additional_jupyterlab.sh new file mode 100644 index 0000000..d48bb46 --- /dev/null +++ b/test/python/install_additional_jupyterlab.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Always run these checks as the non-root user +user="$(whoami)" +check "user" grep vscode <<< "$user" + +# Check for an installation of JupyterLab +check "version" jupyter lab --version + +# Check location of JupyterLab installation +packages="$(python3 -m pip list)" +check "location" grep jupyter <<< "$packages" + +# Check for correct JupyterLab configuration +check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py + +# Report result +reportResults diff --git a/test/python/install_jupyterlab.sh b/test/python/install_jupyterlab.sh index 98b982d..d48bb46 100644 --- a/test/python/install_jupyterlab.sh +++ b/test/python/install_jupyterlab.sh @@ -5,12 +5,19 @@ set -e # Optional: Import test library source dev-container-features-test-lib +# Always run these checks as the non-root user +user="$(whoami)" +check "user" grep vscode <<< "$user" + +# Check for an installation of JupyterLab check "version" jupyter lab --version -check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py -check "user" whoami | grep vscode -check "zsh" zsh --version -check "wget" wget -V +# Check location of JupyterLab installation +packages="$(python3 -m pip list)" +check "location" grep jupyter <<< "$packages" + +# Check for correct JupyterLab configuration +check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py # Report result reportResults diff --git a/test/python/scenarios.json b/test/python/scenarios.json index 2aa246f..9df8d72 100644 --- a/test/python/scenarios.json +++ b/test/python/scenarios.json @@ -9,18 +9,27 @@ } }, "install_jupyterlab": { - "image": "mcr.microsoft.com/vscode/devcontainers/base:focal", + "image": "mcr.microsoft.com/devcontainers/base:focal", "remoteUser": "vscode", "features": { - "common-utils": { - "username": "vscode" - }, "python": { "installJupyterlab": true, "configureJupyterlabAllowOrigin": "*" } } }, + "install_additional_jupyterlab": { + "image": "mcr.microsoft.com/devcontainers/base:focal", + "remoteUser": "vscode", + "features": { + "python": { + "version": "latest", + "additionalVersions": "3.9", + "installJupyterlab": true, + "configureJupyterlabAllowOrigin": "*" + } + } + }, "install_os_provided_python": { "image": "mcr.microsoft.com/devcontainers/base:0-bullseye", "features": { |