From 9c8a00dd1b5e2f41317d39c71e4d491c0a45f710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Duque=20Mesa?= <675763+sduquemesa@users.noreply.github.com> Date: Thu, 6 Jul 2023 19:46:00 +0000 Subject: [PATCH 1/3] add devcontainer --- .devcontainer/dev.Dockerfile | 46 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 36 ++++++++++++++++++++++++++ .devcontainer/post-install.sh | 6 +++++ 3 files changed, 88 insertions(+) create mode 100644 .devcontainer/dev.Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/post-install.sh diff --git a/.devcontainer/dev.Dockerfile b/.devcontainer/dev.Dockerfile new file mode 100644 index 00000000..b8eeb962 --- /dev/null +++ b/.devcontainer/dev.Dockerfile @@ -0,0 +1,46 @@ +FROM python:3.10 + +# Configure apt for setup +ENV DEBIAN_FRONTEND=noninteractive +ENV DOCSPORT 8080 +ENV PYTHONPATH "/workspaces/thewalrus" +EXPOSE 8080 + +RUN apt-get update && \ + apt-get -y install --no-install-recommends sudo \ + zsh \ + less \ + curl \ + wget \ + fonts-powerline \ + locales \ + graphviz \ + pandoc + +### GIT GLOBAL SETUP ### + +RUN git config --global core.excludesfile /.globalgitignore +RUN touch /.globalgitignore +RUN echo "nohup.out" >> /.globalgitignore + +### ZSH TERMINAL SETUP ### + +# generate locale for zsh terminal agnoster theme +RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && /usr/sbin/locale-gen +RUN locale-gen en_US.UTF-8 +# set term to be bash instead of sh +ENV TERM xterm +ENV SHELL /bin/zsh +# install oh-my-zsh +RUN sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + +### PYTHON DEPENDENCIES INTALLATION ### + +# upgrade pip and install package manager +RUN python -m pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir poetry==1.4.0 +RUN poetry config virtualenvs.create false + +### TEAR DOWN IMAGE SETUP ### +# switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..5a76082e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/anaconda +{ + "name": "The Walrus", + "dockerFile": "dev.Dockerfile", + "postCreateCommand": "/bin/zsh ./.devcontainer/post-install.sh", + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.pylint", + "eamodio.gitlens", + "GitHub.vscode-pull-request-github", + "mutantdino.resourcemonitor", + "njpwerner.autodocstring" + ], + "settings": { + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "python.languageServer": "Pylance", + "python.defaultInterpreterPath": "/usr/local/bin/python", + "python.terminal.executeInFileDir": true, + "code-runner.fileDirectoryAsCwd": true, + "terminal.integrated.env.linux": {"PYTHONPATH": "/workspaces/thewalrus"}, + "autoDocstring.docstringFormat": "google" + } + } + }, + "remoteUser": "root" +} diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh new file mode 100644 index 00000000..93e6d9b8 --- /dev/null +++ b/.devcontainer/post-install.sh @@ -0,0 +1,6 @@ +#! /bin/zsh + +pip install -r requirements.txt +pip install -r requirements-dev.txt +pip install -r docs/requirements.txt +pip install -e . \ No newline at end of file From 15d236c2d9d3a8c9d4f7a62485f032390d8c3f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Duque=20Mesa?= <675763+sduquemesa@users.noreply.github.com> Date: Thu, 6 Jul 2023 19:52:26 +0000 Subject: [PATCH 2/3] add eof empty line --- .devcontainer/post-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh index 93e6d9b8..70441a3a 100644 --- a/.devcontainer/post-install.sh +++ b/.devcontainer/post-install.sh @@ -3,4 +3,4 @@ pip install -r requirements.txt pip install -r requirements-dev.txt pip install -r docs/requirements.txt -pip install -e . \ No newline at end of file +pip install -e . From 56faf5d934247810b60bd43b9983f1cd96f1d534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Duque=20Mesa?= <675763+sduquemesa@users.noreply.github.com> Date: Thu, 6 Jul 2023 21:40:14 +0000 Subject: [PATCH 3/3] add `ms-toolsai.jupyter` to extensions --- .devcontainer/devcontainer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5a76082e..572ccadc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,6 +10,7 @@ "ms-python.python", "ms-python.vscode-pylance", "ms-python.pylint", + "ms-toolsai.jupyter", "eamodio.gitlens", "GitHub.vscode-pull-request-github", "mutantdino.resourcemonitor",