From 702a524b5597885e91dacbc8f50ea8d0607e37fc Mon Sep 17 00:00:00 2001
From: Pascal Vizeli <pvizeli@syshack.ch>
Date: Wed, 11 Sep 2019 11:20:21 +0200
Subject: [PATCH] Improve startup of devcontainer (#26572)

---
 .devcontainer/devcontainer.json |  2 +-
 .vscode/tasks.json              | 15 +++++++++++++++
 Dockerfile.dev                  |  6 +++---
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index a025a52e849..e78a8e6851c 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -3,7 +3,7 @@
   "name": "Home Assistant Dev",
   "context": "..",
   "dockerFile": "../Dockerfile.dev",
-  "postCreateCommand": "pip3 install -e .",
+  "postCreateCommand": "mkdir -p config && pip3 install -e .",
   "appPort": 8123,
   "runArgs": ["-e", "GIT_EDITOR=\"code --wait\""],
   "extensions": [
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index f57c182809b..151868a1663 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -19,6 +19,7 @@
       "label": "Pytest",
       "type": "shell",
       "command": "pytest --timeout=10 tests",
+      "dependsOn": ["Install all Test Requirements"],
       "group": {
         "kind": "test",
         "isDefault": true
@@ -85,6 +86,20 @@
         "panel": "new"
       },
       "problemMatcher": []
+    },
+    {
+      "label": "Install all Test Requirements",
+      "type": "shell",
+      "command": "pip3 install -r requirements_test_all.txt -c homeassistant/package_constraints.txt",
+      "group": {
+        "kind": "build",
+        "isDefault": true
+      },
+      "presentation": {
+        "reveal": "always",
+        "panel": "new"
+      },
+      "problemMatcher": []
     }
   ]
 }
diff --git a/Dockerfile.dev b/Dockerfile.dev
index 457dc7b3d0f..eb76fe5b16b 100644
--- a/Dockerfile.dev
+++ b/Dockerfile.dev
@@ -24,9 +24,9 @@ RUN git clone --depth 1 https://github.com/home-assistant/hass-release \
 WORKDIR /workspaces
 
 # Install Python dependencies from requirements
-COPY requirements_test_all.txt homeassistant/package_constraints.txt ./
-RUN pip3 install -r requirements_test_all.txt -c package_constraints.txt \
-    && rm -f requirements_test_all.txt package_constraints.txt
+COPY requirements_test.txt homeassistant/package_constraints.txt ./
+RUN pip3 install -r requirements_test.txt -c package_constraints.txt \
+    && rm -f requirements_test.txt package_constraints.txt
 
 # Set the default shell to bash instead of sh
 ENV SHELL /bin/bash
-- 
GitLab