From 8c1c8a87fd0cde1e8c5e88d4af05c4b4dc1cb19f Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Sat, 21 Aug 2021 17:21:23 -0700 Subject: [PATCH 1/2] chore: setup codespaces --- .devcontainer/Dockerfile | 17 +++++++++++++ .devcontainer/devcontainer.json | 45 +++++++++++++++++++++++++++++++++ 2 files changed, 62 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 00000000000..93e6be8034d --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3/.devcontainer/base.Dockerfile + +# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6 +ARG VARIANT="3.9" +FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} +ENV POETRY_VIRTUALENVS_IN_PROJECT=true + +# [Option] Install Node.js +ARG INSTALL_NODE="true" +ARG NODE_VERSION="lts/*" +RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi + +RUN pip3 install -U pip black poetry pre-commit + +# [Optional] Uncomment this section to install additional OS packages. +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends bash-completion diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..fdf29829083 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,45 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +{ + "name": "Python 3", + "build": { + "dockerfile": "Dockerfile", + "context": "..", + "args": { + "VARIANT": "3.9", + "INSTALL_NODE": "true", + "NODE_VERSION": "lts/*" + } + }, + "settings": { + "git.enableCommitSigning": true, + "editor.formatOnSave": true, + "python.pythonPath": "/usr/local/bin/python", + "python.languageServer": "Pylance", + "python.linting.enabled": true, + "python.linting.pylintEnabled": true, + "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", + "python.formatting.blackPath": "/usr/local/py-utils/bin/black", + "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", + "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", + "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", + "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", + "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", + "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", + "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.pytestEnabled": true, + "python.formatting.provider": "black" + }, + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "littlefoxteam.vscode-python-test-adapter", + "ms-azuretools.vscode-docker" + ], + "postCreateCommand": "make dev", + "remoteUser": "vscode" +} From c37dfef2fb13d65c932811100b841f9e2befedda Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Sun, 22 Aug 2021 00:35:27 +0000 Subject: [PATCH 2/2] chore: add more vscode extensions --- .devcontainer/devcontainer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fdf29829083..995ac6c4fba 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -38,7 +38,9 @@ "ms-python.python", "ms-python.vscode-pylance", "littlefoxteam.vscode-python-test-adapter", - "ms-azuretools.vscode-docker" + "ms-azuretools.vscode-docker", + "davidanson.vscode-markdownlint", + "bungcip.better-toml" ], "postCreateCommand": "make dev", "remoteUser": "vscode"