Unverified Commit 960f21c2 authored by JP Ungaretti's avatar JP Ungaretti Committed by GitHub

Fix additional Python and JupyterLab edge case (#182)

* Remove bloat from JupyterLab test

* Check location of JupyterLab installation

* Remove common-utils

* Add failing additional with JL test

* Fix Python feature

* Update scenario images

* Bump patch version
parent 8c19bb16
{ {
"id": "python", "id": "python",
"version": "1.0.7", "version": "1.0.8",
"name": "Python", "name": "Python",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/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.", "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.",
......
...@@ -374,6 +374,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then ...@@ -374,6 +374,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
# Additional python versions to be installed but not be set as default. # Additional python versions to be installed but not be set as default.
if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
OLD_INSTALL_PATH="${INSTALL_PATH}"
OLDIFS=$IFS OLDIFS=$IFS
IFS="," IFS=","
read -a additional_versions <<< "$ADDITIONAL_VERSIONS" read -a additional_versions <<< "$ADDITIONAL_VERSIONS"
...@@ -381,6 +382,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then ...@@ -381,6 +382,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
OVERRIDE_DEFAULT_VERSION="false" OVERRIDE_DEFAULT_VERSION="false"
install_python $version install_python $version
done done
INSTALL_PATH="${OLD_INSTALL_PATH}"
IFS=$OLDIFS IFS=$OLDIFS
fi fi
......
#!/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
...@@ -5,12 +5,19 @@ set -e ...@@ -5,12 +5,19 @@ set -e
# Optional: Import test library # Optional: Import test library
source dev-container-features-test-lib 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 "version" jupyter lab --version
check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py
check "user" whoami | grep vscode # Check location of JupyterLab installation
check "zsh" zsh --version packages="$(python3 -m pip list)"
check "wget" wget -V check "location" grep jupyter <<< "$packages"
# Check for correct JupyterLab configuration
check "config" grep ".*.allow_origin = '*'" /home/vscode/.jupyter/jupyter_server_config.py
# Report result # Report result
reportResults reportResults
...@@ -9,18 +9,27 @@ ...@@ -9,18 +9,27 @@
} }
}, },
"install_jupyterlab": { "install_jupyterlab": {
"image": "mcr.microsoft.com/vscode/devcontainers/base:focal", "image": "mcr.microsoft.com/devcontainers/base:focal",
"remoteUser": "vscode", "remoteUser": "vscode",
"features": { "features": {
"common-utils": {
"username": "vscode"
},
"python": { "python": {
"installJupyterlab": true, "installJupyterlab": true,
"configureJupyterlabAllowOrigin": "*" "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": { "install_os_provided_python": {
"image": "mcr.microsoft.com/devcontainers/base:0-bullseye", "image": "mcr.microsoft.com/devcontainers/base:0-bullseye",
"features": { "features": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment