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")/.."
|
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
|
|
|
|
source $location;
|
2023-04-03 21:44:46 +02:00
|
|
|
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
|
2024-01-15 03:08:10 +01:00
|
|
|
echo "Virtual environment created. Run 'source $location' to use it."
|