2019-10-12 15:03:35 +02:00
|
|
|
#!/bin/bash
|
2019-04-17 12:06:00 +02:00
|
|
|
# Set up ESPHome dev environment
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
2023-04-03 21:44:46 +02:00
|
|
|
|
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
|
|
|
|
source venv/bin/activate
|
|
|
|
fi
|
|
|
|
|
2023-07-16 23:19:08 +02:00
|
|
|
# Avoid unsafe git error when running inside devcontainer
|
|
|
|
if [ -n "$DEVCONTAINER" ];then
|
|
|
|
git config --global --add safe.directory "$PWD"
|
|
|
|
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
|
2022-01-03 10:11:28 +01:00
|
|
|
pip3 install --no-use-pep517 -e .
|
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
|
|
|
|
echo "Virtual environment created; source venv/bin/activate to use it"
|