-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metahousekeeping - vscode, dev scripts
- Loading branch information
Showing
9 changed files
with
109 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "ludeeus/integration_blueprint", | ||
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11", | ||
"postCreateCommand": "scripts/setup", | ||
"forwardPorts": [ | ||
8123 | ||
], | ||
"portsAttributes": { | ||
"8123": { | ||
"label": "Home Assistant" | ||
//"onAutoForward": "notify" | ||
} | ||
}, | ||
"customizations": { | ||
"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": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ | |
] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
# Create config dir if not present | ||
if [[ ! -d "${PWD}/config" ]]; then | ||
mkdir -p "${PWD}/config" | ||
hass --config "${PWD}/config" --script ensure_config | ||
fi | ||
|
||
# Set the path to custom_components | ||
## This let's us have the structure we want <root>/custom_components/integration_blueprint | ||
## while at the same time have Home Assistant configuration inside <root>/config | ||
## without resulting to symlinks. | ||
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components" | ||
|
||
# Start Home Assistant | ||
hass --config "${PWD}/config" --debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
ruff check . --fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
# Seems to fix broken aiohttp wheel building in 3.11: | ||
python3 -m pip install --upgrade setuptools wheel | ||
# Fix urllib3 issue https://github.com/home-assistant/core/issues/95192 | ||
python3 -m pip install git+https://github.com/boto/botocore | ||
|
||
python3 -m pip install --requirement requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
# Create a virtual environment | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
# Install requirements | ||
pip install -r requirements_test.txt | ||
# Run tests and get a summary of successes/failures and code coverage | ||
pytest --durations=10 --cov-report term-missing --cov=custom_components.bermuda tests |