diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000..a31be79313703 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + // More info about Features: https://containers.dev/features + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": {}, + + "onCreateCommand": ".devcontainer/setup.sh", + "postCreateCommand": "", + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python" + ], + "settings": {} + } + } +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 0000000000000..90532c6912a6b --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +"${SHELL}" <(curl -Ls micro.mamba.pm/install.sh) < /dev/null + +conda init --all +micromamba shell init -s bash + +micromamba env create -f build_tools/circle/doc_environment.yml -n sklearn-dev --yes +echo "micromamba activate sklearn-dev" >> $HOME/.bashrc + +# Note that `micromamba activate sklearn-dev` doesn't work, it must be run by the +# user (same applies to `conda activate`) + +# Enables users to activate environment without having to specify the full path +echo "envs_dirs: + - /home/codespace/micromamba/envs" > /opt/conda/.condarc