From 72338eb5b88ac2cf9031affe6d194f74acc58b94 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Mon, 24 Jun 2019 14:48:10 +0200 Subject: [PATCH] Add devcontainer support (#1134) --- .devcontainer/Dockerfile | 12 ++++++++++++ .devcontainer/devcontainer.json | 18 ++++++++++++++++++ 2 files changed, 30 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 000000000..594abb81c --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.7 + +WORKDIR /workspace + +# Install Python dependencies from requirements.txt if it exists +COPY requirements.txt requirements_tests.txt /workspace/ +RUN pip install -r requirements.txt \ + && pip3 install -r requirements_tests.txt \ + && pip install black tox + +# Set the default shell to bash instead of sh +ENV SHELL /bin/bash diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..a27fe99b0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +// See https://aka.ms/vscode-remote/devcontainer.json for format details. +{ + "name": "Hass.io dev", + "context": "..", + "dockerFile": "Dockerfile", + "extensions": [ + "ms-python.python" + ], + "settings": { + "python.pythonPath": "/usr/local/bin/python", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "python.formatting.provider": "black", + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnType": true + } +} \ No newline at end of file