From ceefff98ee419a99acdadabefee55ec5d8d068e4 Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Fri, 23 Sep 2022 22:57:28 +0000 Subject: [PATCH 1/7] Remove bloat from JupyterLab test --- test/python/install_jupyterlab.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/python/install_jupyterlab.sh b/test/python/install_jupyterlab.sh index 98b982d1a..cb22982fc 100644 --- a/test/python/install_jupyterlab.sh +++ b/test/python/install_jupyterlab.sh @@ -5,12 +5,17 @@ set -e # Optional: Import test library source dev-container-features-test-lib +# Run these checks as the non-root user +check "user" whoami | grep vscode + +# 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 +# check "location" /usr/local/python/current/bin/python3 -m pip list | grep jupyter + +# Check for correct JupyterLab configuration +check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py # Report result reportResults From 861e65c68dd6536f43e429ae2d3883a1c706d495 Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Fri, 23 Sep 2022 23:13:09 +0000 Subject: [PATCH 2/7] Check location of JupyterLab installation --- test/python/install_jupyterlab.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/python/install_jupyterlab.sh b/test/python/install_jupyterlab.sh index cb22982fc..d48bb4683 100644 --- a/test/python/install_jupyterlab.sh +++ b/test/python/install_jupyterlab.sh @@ -5,14 +5,16 @@ set -e # Optional: Import test library source dev-container-features-test-lib -# Run these checks as the non-root user -check "user" whoami | grep vscode +# 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 -# check "location" /usr/local/python/current/bin/python3 -m pip list | grep jupyter +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 From 26b355187f0534418bc185ca78daa05b7bf0772c Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Fri, 23 Sep 2022 23:13:58 +0000 Subject: [PATCH 3/7] Remove common-utils --- test/python/scenarios.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/python/scenarios.json b/test/python/scenarios.json index 2aa246f45..2d31eb44f 100644 --- a/test/python/scenarios.json +++ b/test/python/scenarios.json @@ -12,9 +12,6 @@ "image": "mcr.microsoft.com/vscode/devcontainers/base:focal", "remoteUser": "vscode", "features": { - "common-utils": { - "username": "vscode" - }, "python": { "installJupyterlab": true, "configureJupyterlabAllowOrigin": "*" From 02f79f288d2a8489b6fbcf33787017df832aecd6 Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Fri, 23 Sep 2022 23:25:10 +0000 Subject: [PATCH 4/7] Add failing additional with JL test --- test/python/install_additional_jupyterlab.sh | 23 ++++++++++++++++++++ test/python/scenarios.json | 12 ++++++++++ 2 files changed, 35 insertions(+) create mode 100644 test/python/install_additional_jupyterlab.sh diff --git a/test/python/install_additional_jupyterlab.sh b/test/python/install_additional_jupyterlab.sh new file mode 100644 index 000000000..d48bb4683 --- /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/scenarios.json b/test/python/scenarios.json index 2d31eb44f..66f78c326 100644 --- a/test/python/scenarios.json +++ b/test/python/scenarios.json @@ -18,6 +18,18 @@ } } }, + "install_additional_jupyterlab": { + "image": "mcr.microsoft.com/vscode/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": { From 07ecace94367b1835aef96889227bb14cd7b30f7 Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Sat, 24 Sep 2022 00:01:46 +0000 Subject: [PATCH 5/7] Fix Python feature --- src/python/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/python/install.sh b/src/python/install.sh index 2a0dd55cd..3cf3a8867 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 From 2ba3c1390782a2f3d89f7b788cfc586726ec61b7 Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Mon, 26 Sep 2022 17:07:15 +0000 Subject: [PATCH 6/7] Update scenario images --- test/python/scenarios.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/python/scenarios.json b/test/python/scenarios.json index 66f78c326..9df8d72de 100644 --- a/test/python/scenarios.json +++ b/test/python/scenarios.json @@ -9,7 +9,7 @@ } }, "install_jupyterlab": { - "image": "mcr.microsoft.com/vscode/devcontainers/base:focal", + "image": "mcr.microsoft.com/devcontainers/base:focal", "remoteUser": "vscode", "features": { "python": { @@ -19,7 +19,7 @@ } }, "install_additional_jupyterlab": { - "image": "mcr.microsoft.com/vscode/devcontainers/base:focal", + "image": "mcr.microsoft.com/devcontainers/base:focal", "remoteUser": "vscode", "features": { "python": { From d23c4fa7576288d7f20afb42ab3a47bb8caa0e9d Mon Sep 17 00:00:00 2001 From: JP Ungaretti Date: Mon, 26 Sep 2022 17:15:19 +0000 Subject: [PATCH 7/7] Bump patch version --- src/python/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index 6d28941de..0c90e0b02 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.",