Skip to content

Commit 105d2ef

Browse files
dev: Improved setup a tiny bit more
1 parent c3fc824 commit 105d2ef

File tree

6 files changed

+89
-40
lines changed

6 files changed

+89
-40
lines changed

.devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
},
3939
"remoteUser": "vscode",
4040
"features": {
41+
"ghcr.io/va-h/devcontainers-features/uv:1": {},
4142
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
4243
"packages": [
4344
"ffmpeg",

pyproject.toml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ name = "panda_status"
33
version = "1.2.0"
44
requires-python = ">=3.13.2"
55
dependencies = [
6-
"colorlog>=6.9.0",
7-
"hassil>=3.2.0",
6+
"colorlog",
7+
"ffmpeg",
8+
"ha-ffmpeg",
9+
"hassil",
810
"home-assistant-intents==2025.9.3",
911
"homeassistant==2025.8.1",
10-
"mutagen>=1.47.0",
11-
"numpy>=2.3.2",
12+
"mutagen",
13+
"numpy",
1214
"pip>=25.2",
15+
"pip>=25.2",
16+
"pymicro-vad",
17+
"pyspeex-noise",
18+
"PyTurboJPEG",
1319
"ruff>=0.12.12",
14-
"websockets>=15.0.1",
15-
]
16-
17-
[dependency-groups]
18-
dev = [
19-
"ruff>=0.12.12"
20+
"ruff>=0.12.12",
21+
"websockets",
22+
"websockets",
2023
]

scripts/develop

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7+
echo "🐼 [develop] Starting Home Assistant development environment in $(pwd)"
8+
79
# Create config dir if not present
810
if [[ ! -d "${PWD}/config" ]]; then
11+
echo "📁 [develop] Creating config directory..."
912
mkdir -p "${PWD}/config"
10-
hass --config "${PWD}/config" --script ensure_config
13+
echo "⚙️ [develop] Ensuring Home Assistant config..."
14+
uv run hass --config "${PWD}/config" --script ensure_config
15+
echo "✅ [develop] Config directory ready."
1116
fi
1217

1318
# Set the path to custom_components
14-
## This let's us have the structure we want <root>/custom_components/panda_status
15-
## while at the same time have Home Assistant configuration inside <root>/config
16-
## without resulting to symlinks.
19+
echo "🔧 [develop] Setting PYTHONPATH for custom_components..."
1720
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components"
1821

1922
# Start Home Assistant
20-
hass --config "${PWD}/config" --debug
23+
echo "🚀 [develop] Starting Home Assistant with debug mode..."
24+
uv run hass --config "${PWD}/config" --debug

scripts/lint

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,15 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
ruff format .
8-
ruff check . --fix
7+
echo "🐼 [lint] Starting linting in $(pwd)"
8+
9+
# Run ruff format and check
10+
echo "🧹 [lint] Running ruff format..."
11+
uv run ruff format .
12+
echo "✅ [lint] Formatting complete."
13+
14+
echo "🔎 [lint] Running ruff check with --fix..."
15+
uv run ruff check . --fix
16+
echo "✅ [lint] Linting complete."
17+
18+
echo "🎉 [lint] Linting finished."

scripts/setup

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,29 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
uv venv && uv pip install -r pyproject.toml
7+
echo "🐼 [setup] Starting setup in $(pwd)"
8+
9+
# Download UV if not present
10+
if ! command -v uv >/dev/null 2>&1; then
11+
echo "🔍 [setup] 'uv' not found. Installing UV..."
12+
curl -LsSf https://astral.sh/uv/install.sh | sh
13+
echo "✅ [setup] UV installed."
14+
else
15+
echo "✅ [setup] 'uv' is already installed."
16+
fi
17+
18+
# Create venv if not present
19+
if [[ ! -d "${PWD}/.venv" ]]; then
20+
echo "🔧 [setup] Creating Python virtual environment (.venv)..."
21+
uv venv
22+
echo "✅ [setup] Virtual environment created."
23+
else
24+
echo "✅ [setup] Virtual environment already exists."
25+
fi
26+
27+
# Install dependencies
28+
echo "📦 [setup] Installing dependencies with uv..."
29+
uv sync --dev --frozen --link-mode=copy
30+
echo "✅ [setup] Dependencies installed."
31+
32+
echo "🎉 [setup] Setup complete."

uv.lock

Lines changed: 28 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)