diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..88d64fb --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Poetry doesn't yet support Python 3.10 +FROM python:3.9.7 + +# Environment variables +ENV PYTHONFAULTHANDLER=1 \ + PYTHONUNBUFFERED=1 \ + PIP_DEFAULT_TIMEOUT=100 \ + POETRY_VIRTUALENVS_CREATE=false \ + PATH="~/.local/bin:$PATH" + +# Copy all project files +COPY . . + +# Install poetry and dependencies +RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - && ~/.local/bin/poetry install --no-ansi --no-interaction + +# Install pre-commit +RUN pre-commit diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..791cc4c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.1/containers/python-3 +{ + "name": "WTPython", + "build": { + "dockerfile": "Dockerfile", + "context": ".." // Set the workdir to be the parent directory of devcontainer.json + }, + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "python.linting.enabled": true, + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.vscode-pylance", + "ms-python.python", + "github.vscode-pull-request-github", + "github.copilot", + "eamodio.gitlens" + ], + // Features that vscode will install on build + "features": { + "git": "latest" + } +}