diff --git a/.github/.devcontainer/devcontainer.json b/.github/.devcontainer/devcontainer.json index 8f1a261..14df094 100644 --- a/.github/.devcontainer/devcontainer.json +++ b/.github/.devcontainer/devcontainer.json @@ -10,38 +10,15 @@ }, "remoteUser": "vscode", "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "installZsh": "true", - "username": "vscode", - "userUid": "1000", - "userGid": "1000", - "upgradePackages": "true" - }, - "ghcr.io/devcontainers/features/git:1": { - "version": "latest", - "ppa": "false" - }, - "ghcr.io/rocker-org/devcontainer-features/r-rig:1": { - "version": "release", - "vscodeRSupport": "none", - "installDevTools": "false", - "installREnv": "true", - "installRMarkdown": "false" - }, - "ghcr.io/devcontainers/features/python:1": { - "version": "latest", - "enableShared": "true" - }, - "ghcr.io/julialang/devcontainer-features/julia:1": { - "channel": "release" - }, "./quarto-computing-dependencies": { - "dependencies": "all" - }, - "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": { - "version": "prerelease", - "installTinyTex": "true", - "installChromium": "false" - } + "rDeps": "rmarkdown,httpgd", + "pythonDeps": "jupyter,papermill", + "juliaDeps": "IJulia" + }//, + // "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": { + // "version": "prerelease", + // "installTinyTex": "true", + // "installChromium": "false" + // } } } diff --git a/.github/.devcontainer/quarto-computing-dependencies/devcontainer-feature.json b/.github/.devcontainer/quarto-computing-dependencies/devcontainer-feature.json index e7c688c..8a5c7f6 100644 --- a/.github/.devcontainer/quarto-computing-dependencies/devcontainer-feature.json +++ b/.github/.devcontainer/quarto-computing-dependencies/devcontainer-feature.json @@ -4,21 +4,52 @@ "name": "Install Computing Dependencies for Quarto", "description": "Install R, Python, and Julia dependencies for Quarto.", "options": { - "dependencies": { + "rDeps": { "type": "string", - "enum": ["all", "r", "python", "julia"], - "default": "all", - "description": "Specify what dependencies to install." - } + "default": "rmarkdown", + "description": "Specify what R dependencies to install." + }, + "pythonDeps": { + "type": "string", + "default": "jupyter,papermill", + "description": "Specify what Python dependencies to install." + }, + "juliaDeps": { + "type": "string", + "default": "IJulia", + "description": "Specify what Julia dependencies to install." + } }, "dependsOn": { - "ghcr.io/devcontainers/features/common-utils": {}, - "ghcr.io/rocker-org/devcontainer-features/r-rig": {}, - "ghcr.io/devcontainers/features/python": {}, - "ghcr.io/julialang/devcontainer-features/julia": {} + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "vscode", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + }, + "ghcr.io/devcontainers/features/git:1": { + "version": "latest", + "ppa": "false" + }, + "ghcr.io/rocker-org/devcontainer-features/r-rig:1": { + "version": "release", + "vscodeRSupport": "none", + "installDevTools": "false", + "installREnv": "true", + "installRMarkdown": "false" + }, + "ghcr.io/devcontainers/features/python:1": { + "version": "latest", + "enableShared": "true" + }, + "ghcr.io/julialang/devcontainer-features/julia:1": { + "channel": "release" + } }, "installsAfter": [ "ghcr.io/devcontainers/features/common-utils", + "ghcr.io/devcontainers/features/git", "ghcr.io/rocker-org/devcontainer-features/r-rig", "ghcr.io/devcontainers/features/python", "ghcr.io/julialang/devcontainer-features/julia" diff --git a/.github/.devcontainer/quarto-computing-dependencies/install.sh b/.github/.devcontainer/quarto-computing-dependencies/install.sh index d8a2998..a53403d 100755 --- a/.github/.devcontainer/quarto-computing-dependencies/install.sh +++ b/.github/.devcontainer/quarto-computing-dependencies/install.sh @@ -4,10 +4,12 @@ set -e export DEBIAN_FRONTEND=noninteractive -DEPENDENCIES=${DEPENDENCIES:-"all"} - USERNAME=${USERNAME:-${_REMOTE_USER:-"automatic"}} +R_DEPS=${RDEPS:-"rmarkdown"} +PYTHON_DEPS=${PYTHONDEPS:-"jupyter,papermill"} +JULIA_DEPS=${JULIADEPS:-"IJulia"} + set -e if [ "$(id -u)" -ne 0 ]; then @@ -33,30 +35,23 @@ elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then fi quarto_r_deps() { - su "${USERNAME}" -c "Rscript -e 'pak::pkg_install(\"rmarkdown\")'" + local deps=$1 + deps=$(echo "${deps}" | sed 's/,/","/g') + su "${USERNAME}" -c "Rscript -e 'pak::pkg_install(c(\"${deps}\"))'" } quarto_python_deps() { - su "${USERNAME}" -c "python3 -m pip install jupyter papermill" + local deps=$1 + deps=$(echo "${deps}" | sed 's/,/ /g') + python3 -m pip install ${deps} } quarto_julia_deps() { - su "${USERNAME}" -c "~/.juliaup/bin/julia -e 'using Pkg; Pkg.add(\"IJulia\")'" + local deps=$1 + deps=$(echo "${deps}" | sed 's/,/","/g') + su "${USERNAME}" -c "~/.juliaup/bin/julia -e 'using Pkg; Pkg.add.([\"${deps}\"])'" } -case ${DEPENDENCIES} in - all) - quarto_r_deps - quarto_python_deps - quarto_julia_deps - ;; - r) - quarto_r_deps - ;; - python) - quarto_python_deps - ;; - julia) - quarto_julia_deps - ;; -esac +quarto_r_deps ${R_DEPS} +quarto_python_deps ${PYTHON_DEPS} +quarto_julia_deps ${JULIA_DEPS}