2024-08-05 06:15:19 +02:00
|
|
|
#!/usr/bin/env bash
|
2019-04-17 12:06:00 +02:00
|
|
|
# Set up ESPHome dev environment
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
2024-01-15 03:08:10 +01:00
|
|
|
location="venv/bin/activate"
|
2023-06-21 06:36:54 +02:00
|
|
|
if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$VIRTUAL_ENV" ] && [ ! "$ESPHOME_NO_VENV" ]; then
|
2023-04-03 21:44:46 +02:00
|
|
|
python3 -m venv venv
|
2024-01-15 03:08:10 +01:00
|
|
|
if [ -f venv/Scripts/activate ]; then
|
|
|
|
location="venv/Scripts/activate"
|
|
|
|
fi
|
2024-05-16 03:19:37 +02:00
|
|
|
source $location
|
2023-04-03 21:44:46 +02:00
|
|
|
fi
|
|
|
|
|
2024-01-03 06:00:52 +01:00
|
|
|
pip3 install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt -r requirements_dev.txt
|
2023-06-21 06:36:54 +02:00
|
|
|
pip3 install setuptools wheel
|
2024-05-19 01:31:36 +02:00
|
|
|
pip3 install -e ".[dev,test,displays]" --config-settings editable_mode=compat
|
2021-03-07 20:03:16 +01:00
|
|
|
|
|
|
|
pre-commit install
|
2023-04-27 02:26:06 +02:00
|
|
|
|
2023-05-01 05:57:57 +02:00
|
|
|
script/platformio_install_deps.py platformio.ini --libraries --tools --platforms
|
2024-01-03 06:00:52 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo
|
2024-01-15 03:08:10 +01:00
|
|
|
echo "Virtual environment created. Run 'source $location' to use it."
|