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..572ccadc --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +// 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", + "ms-toolsai.jupyter", + "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..70441a3a --- /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 .