Skip to content

Commit

Permalink
Use bootstrap in devcontainer (home-assistant#45968)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Feb 4, 2021
1 parent 06e6005 commit 7e9500e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "Home Assistant Dev",
"context": "..",
"dockerFile": "../Dockerfile.dev",
"postCreateCommand": "mkdir -p config && pip3 install -e .",
"postCreateCommand": "script/bootstrap",
"containerEnv": { "DEVCONTAINER": "1" },
"appPort": 8123,
"runArgs": ["-e", "GIT_EDITOR=code --wait"],
"extensions": [
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ repos:
rev: v1.24.2
hooks:
- id: yamllint
- repo: https://github.com/prettier/prettier
rev: 2.0.4
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
stages: [manual]
Expand Down
9 changes: 9 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ fi
echo "Installing development dependencies..."
python3 -m pip install wheel --constraint homeassistant/package_constraints.txt
python3 -m pip install tox colorlog pre-commit $(grep mypy requirements_test.txt) $(grep stdlib-list requirements_test.txt) $(grep tqdm requirements_test.txt) $(grep pipdeptree requirements_test.txt) $(grep awesomeversion requirements.txt) --constraint homeassistant/package_constraints.txt

if [ -n "$DEVCONTAINER" ];then
pre-commit install
pre-commit install-hooks
python3 -m pip install -e . --constraint homeassistant/package_constraints.txt

mkdir -p config
hass --script ensure_config -c config
fi

0 comments on commit 7e9500e

Please sign in to comment.