scripts: add option to install python testing environment

Defaults to false, it builds the python environment when --build-python option is provided
This commit is contained in:
Shubham Patil
2025-04-30 15:06:28 +05:30
parent 78bc8e21c9
commit b4b7397b93
+16
View File
@@ -8,6 +8,7 @@ print_help() {
echo " --no-host-tool Disable installation of host tools"
echo " --no-bootstrap Disable sourcing connectedhomeip's scripts/bootstrap.sh,"
echo " This can be helpful if there's already present connectedhomeip setup"
echo " --build-python Build Python environment for running Python test scripts"
echo " --help Display this help message"
}
@@ -19,6 +20,7 @@ echo_log() {
# Parse command-line arguments
NO_HOST_TOOL=false
NO_BOOTSTRAP=false
BUILD_PYTHON=false
while [[ "$#" -gt 0 ]]; do
case $1 in
@@ -28,6 +30,9 @@ while [[ "$#" -gt 0 ]]; do
--no-bootstrap)
NO_BOOTSTRAP=true
;;
--build-python)
BUILD_PYTHON=true
;;
--help)
print_help
exit 1
@@ -80,5 +85,16 @@ else
python3 -m pip install -r ${ESP_MATTER_PATH}/requirements.txt > /dev/null
fi
if [ $BUILD_PYTHON = true ]; then
echo_log "Building Python testing environment"
cd ${MATTER_PATH}
./scripts/build_python.sh --enable_ble true --chip_detail_logging true -i out/py_env
if [ $? -ne 0 ]; then
echo_log "Failed to build Python testing environment"
fi
cd ${ESP_MATTER_PATH}
fi
echo_log "All done! You can now run:"
echo_log " . ${basedir}/export.sh"