From a8075723827195a1674ff316732783a285cea404 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli <pvizeli@syshack.ch> Date: Sun, 23 Jun 2019 21:18:33 +0200 Subject: [PATCH] Add initial support for remote dev container (#24681) * Add initial support for remote container * Use constrain --- .devcontainer/Dockerfile | 17 +++++++++++++++++ .devcontainer/devcontainer.json | 15 +++++++++++++++ .gitignore | 1 - 3 files changed, 32 insertions(+), 1 deletion(-) 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..423f93f7ec9 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.7 + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libudev-dev libavformat-dev libavcodec-dev libavdevice-dev \ + libavutil-dev libswscale-dev libswresample-dev libavfilter-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace + +# Install Python dependencies from requirements.txt if it exists +COPY requirements_test_all.txt homeassistant/package_constraints.txt /workspace/ +RUN pip3 install -r requirements_test_all.txt -c package_constraints.txt + +# 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 00000000000..4bc64937a62 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,15 @@ +// See https://aka.ms/vscode-remote/devcontainer.json for format details. +{ + "name": "Home Assistant Dev", + "context": "..", + "dockerFile": "Dockerfile", + "postCreateCommand": "pip3 install -e .", + "extensions": [ + "ms-python.python" + ], + "settings": { + "python.pythonPath": "/usr/local/bin/python", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 397a584c28e..7a0cb29bc2b 100644 --- a/.gitignore +++ b/.gitignore @@ -95,7 +95,6 @@ virtualization/vagrant/config # Visual Studio Code .vscode -.devcontainer # Built docs docs/build -- GitLab