Skip to content

Commit

Permalink
Updates to dev loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sebr committed Apr 23, 2024
1 parent dc4876b commit af01bb7
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 38 deletions.
58 changes: 29 additions & 29 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
{
"name": "sebr/bhyve-home-assistant",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye",
"postCreateCommand": "scripts/setup",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.12",
"postCreateCommand": "scripts/setup-devcontainer",
"forwardPorts": [
8123
8123
],
"remoteEnv": {
"TZ": "Australia/Sydney"
},
"portsAttributes": {
"8123": {
"label": "Home Assistant",
"onAutoForward": "notify"
}
"8123": {
"label": "Home Assistant",
"onAutoForward": "notify"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
"vscode": {
"extensions": [
"ms-python.python",
"github.vscode-pull-request-github",
"ryanluker.vscode-coverage-gutters",
"ms-python.vscode-pylance"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 4,
"python.pythonPath": "/usr/bin/python3",
"python.analysis.autoSearchPaths": false,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
}
}
}
},
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers/features/rust:1": {

}
"ghcr.io/devcontainers/features/rust:1": {}
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.DS_Store
__pycache__
*.pyc
.venv
core

tmp

Expand Down
2 changes: 1 addition & 1 deletion scripts/develop
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fi
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components"

# Start Home Assistant
hass --config "${PWD}/config" --debug
hass --config "${PWD}/config" --debug
8 changes: 0 additions & 8 deletions scripts/setup

This file was deleted.

11 changes: 11 additions & 0 deletions scripts/setup-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -ex
cd "$(dirname "$0")/.."

source .venv/bin/activate

pip3 install -r core/requirements.txt
pip3 install -r core/requirements_test.txt

pip3 install -e core/
# pip3 install $(python3 test_dependencies.py)
16 changes: 16 additions & 0 deletions scripts/setup-devcontainer
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/.."

# Clone only if the folder doesn't exist
if [[ ! -d "core" ]]; then
git clone --depth 1 --branch dev https://github.com/home-assistant/core.git
fi

pip3 install \
colorlog==6.7.0 \
ruff==0.0.265

./scripts/setup-dependencies
./scripts/setup-symlinks
pre-commit install-hooks
13 changes: 13 additions & 0 deletions scripts/setup-symlinks
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -ex
cd "$(dirname "$0")/.."

# Link custom components
cd core/homeassistant/components/
ln -fs ../../../custom_components/bhyve bhyve
cd -

# Link tests
cd core/tests/components/
ln -fs ../../../tests/ bhyve
cd -

0 comments on commit af01bb7

Please sign in to comment.