Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vscode devcontainer / github codespaces #370

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
46 changes: 46 additions & 0 deletions .devcontainer/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
6 changes: 6 additions & 0 deletions .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
@@ -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 .
Loading