From c6eed9329b728993da8c42cd28c3439cc344ffed Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Mon, 3 Nov 2025 17:00:08 +0000 Subject: [PATCH] update dev environment --- scripts/bootstrap | 7 ++++++- scripts/develop | 14 ++++++++++---- scripts/setup | 3 ++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index 8f39b10..3581b0a 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -10,14 +10,19 @@ echo "==> Updating system packages..." sudo apt-get update sudo apt-get upgrade -y +rm -rf .venv/ + echo "==> Checking for uv..." if ! command -v uv >/dev/null 2>&1; then echo "UV not found, installing..." pipx install uv fi +echo "==> Setting up Python environment..." +uv venv && . .venv/bin/activate + echo "==> Installing dependencies..." -python3 -m pip install --requirement requirements.txt +uv pip install --requirement requirements.txt echo "==> Installing pre-commit hooks..." pre-commit install diff --git a/scripts/develop b/scripts/develop index a42e449..5124b11 100755 --- a/scripts/develop +++ b/scripts/develop @@ -1,13 +1,19 @@ -#!/usr/bin/env bash +#!/bin/sh + +# script/develop: Start Home Assistant in development mode set -e cd "$(dirname "$0")/.." +if [ -z "$VIRTUAL_ENV" ]; then + . .venv/bin/activate +fi + # Create config dir if not present -if [[ ! -d "${PWD}/config" ]]; then - mkdir -p "${PWD}/config" - hass --config "${PWD}/config" --script ensure_config +if [ ! -d "${PWD}/config" ]; then + mkdir -p "${PWD}/config" + hass --config "${PWD}/config" --script ensure_config fi # Set the path to custom_components diff --git a/scripts/setup b/scripts/setup index 80dcd84..d942def 100755 --- a/scripts/setup +++ b/scripts/setup @@ -1,10 +1,11 @@ #!/usr/bin/env bash +# script/setup: Setup script used by DevContainers to prepare the project + set -e cd "$(dirname "$0")/.." -#python3 -m pip install --requirement requirements.txt scripts/bootstrap echo "==> Project is now ready to go!"