mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
[core] Consolidate setup scripts into a cross-platform setup.py
script/setup and script/setup.bat implemented the same workflow and were kept in sync by hand, which had already drifted: the worktree hook fix in #18843 landed in the bash script only. Both are now thin wrappers around script/setup.py, so there is one implementation to maintain. The post-checkout hook also checks for a venv/Scripts layout before doing anything, so a branch switch on Windows can no longer clear a working virtual environment.
This commit is contained in:
+1
-28
@@ -1,28 +1 @@
|
||||
@echo off
|
||||
|
||||
if defined VIRTUAL_ENV goto :install
|
||||
|
||||
echo Starting the Virtual Environment
|
||||
python -m venv venv
|
||||
call venv/Scripts/activate
|
||||
echo Running the Virtual Environment
|
||||
|
||||
:install
|
||||
|
||||
echo Installing required packages...
|
||||
|
||||
python.exe -m pip install --upgrade pip
|
||||
|
||||
pip3 install -r requirements.txt -r requirements_test.txt -r requirements_dev.txt
|
||||
pip3 install setuptools wheel
|
||||
pip3 install -e ".[dev,test]" --config-settings editable_mode=compat
|
||||
|
||||
rem --overwrite replaces any hook already in place. Without it, prek finds a
|
||||
rem previously installed pre-commit hook, moves it aside to
|
||||
rem .git/hooks/pre-commit.legacy and keeps calling it, so every commit would
|
||||
rem run both tools.
|
||||
prek install --overwrite
|
||||
|
||||
echo .
|
||||
echo .
|
||||
echo Virtual environment created. Run 'venv/Scripts/activate' to use it.
|
||||
@python "%~dp0setup.py" %*
|
||||
|
||||
Reference in New Issue
Block a user