From d56b42c0365ac84e2d986d0d3e6a39ae09aca0e2 Mon Sep 17 00:00:00 2001 From: Ethan Henry <79533577+ethansocal@users.noreply.github.com> Date: Thu, 11 Nov 2021 02:29:58 +0000 Subject: [PATCH 1/2] add devcontainer --- .devcontainer/Dockerfile | 18 ++++++++++++++++++ .devcontainer/devcontainer.json | 26 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..3fc8aa9 --- /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 install \ No newline at end of file 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" + } +} From e51b6ef2d79481f766d00f7f1777e63edc98e4fd Mon Sep 17 00:00:00 2001 From: Ethan Henry <79533577+ethansocal@users.noreply.github.com> Date: Thu, 11 Nov 2021 02:42:11 +0000 Subject: [PATCH 2/2] Fix linting --- .devcontainer/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 3fc8aa9..88d64fb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -8,11 +8,11 @@ ENV PYTHONFAULTHANDLER=1 \ POETRY_VIRTUALENVS_CREATE=false \ PATH="~/.local/bin:$PATH" -# Copy all project files +# 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 install \ No newline at end of file +RUN pre-commit