Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/python/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
2 changes: 2 additions & 0 deletions src/python/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,15 @@ 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"
for version in "${additional_versions[@]}"; do
OVERRIDE_DEFAULT_VERSION="false"
install_python $version
done
INSTALL_PATH="${OLD_INSTALL_PATH}"
IFS=$OLDIFS
fi

Expand Down
23 changes: 23 additions & 0 deletions test/python/install_additional_jupyterlab.sh
Original file line number Diff line number Diff line change
@@ -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
15 changes: 11 additions & 4 deletions test/python/install_jupyterlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 13 additions & 4 deletions test/python/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down