Skip to content

Commit

Permalink
Fix matter_yamltests_distribution path after pigweed update
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq committed Oct 22, 2024
1 parent 2f22242 commit ea8fdc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
4 changes: 2 additions & 2 deletions scripts/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import("$dir_pw_build/python_dist.gni")

# This target creates a single Python package and wheel for yamltests. It will
# merge all Python dependencies Matter. The output is located in:
# out/obj/matter_yamltests_distribution/ <- source files here
# out/obj/matter_yamltests_distribution._build_wheel/matter_yamltests-0.0.1-py3-none-any.whl
# out/obj/scripts/matter_yamltests_distribution/ <- source files here
# out/obj/scripts/matter_yamltests_distribution._build_wheel/matter_yamltests-0.0.1-py3-none-any.whl
pw_python_distribution("matter_yamltests_distribution") {
packages = [ "${chip_root}/scripts/py_matter_yamltests:matter_yamltests" ]
generate_setup_cfg = {
Expand Down
28 changes: 5 additions & 23 deletions scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,22 +175,6 @@ tracing_options="matter_log_json_payload_hex=true matter_log_json_payload_decode

gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="$tracing_options chip_detail_logging=$chip_detail_logging chip_project_config_include_dirs=[\"//config/python\"] $chip_mdns_arg $chip_case_retry_arg $pregen_dir_arg chip_config_network_layer_ble=$enable_ble chip_enable_ble=$enable_ble chip_crypto=\"boringssl\""

function ninja_target() {
# Print the ninja target required to build a gn label.
local GN_LABEL="$1"
local NINJA_TARGET="$(gn ls "$OUTPUT_ROOT" --as=output "$GN_LABEL")"
echo "$NINJA_TARGET"
}

function wheel_output_dir() {
# Print the wheel output directory for a pw_python_package or
# pw_python_distribution. The label must end in "._build_wheel".
local GN_LABEL="$1"
local NINJA_TARGET="$(ninja_target "$GN_LABEL")"
local WHEEL_DIR="$OUTPUT_ROOT"/"$(dirname "$NINJA_TARGET")/$(basename -s .stamp "$NINJA_TARGET")"
echo "$WHEEL_DIR"
}

# Compile Python wheels
ninja -C "$OUTPUT_ROOT" python_wheels

Expand All @@ -200,6 +184,11 @@ WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl)
# Add the matter_testing_infrastructure wheel
WHEEL+=("$OUTPUT_ROOT"/python/obj/src/python_testing/matter_testing_infrastructure/chip-testing._build_wheel/chip_testing-*.whl)

if [ "$install_pytest_requirements" = "yes" ]; then
# Add the matter_yamltests_distribution wheel
WHEEL+=("$OUTPUT_ROOT"/obj/scripts/matter_yamltests_distribution._build_wheel/matter_yamltests-*.whl)
fi

if [ -n "$extra_packages" ]; then
WHEEL+=("$extra_packages")
fi
Expand All @@ -221,14 +210,7 @@ if [ -n "$install_virtual_env" ]; then
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade "${WHEEL[@]}"

if [ "$install_pytest_requirements" = "yes" ]; then
YAMLTESTS_GN_LABEL="//scripts:matter_yamltests_distribution._build_wheel"
# Add wheels from pw_python_package or pw_python_distribution templates.
YAMLTEST_WHEEL=(
"$(ls -tr "$(wheel_output_dir "$YAMLTESTS_GN_LABEL")"/*.whl | head -n 1)"
)

echo_blue "Installing python test dependencies ..."
"$ENVIRONMENT_ROOT"/bin/pip install --upgrade "${YAMLTEST_WHEEL[@]}"
"$ENVIRONMENT_ROOT"/bin/pip install -r "$CHIP_ROOT/scripts/tests/requirements.txt"
"$ENVIRONMENT_ROOT"/bin/pip install -r "$CHIP_ROOT/src/python_testing/requirements.txt"
fi
Expand Down

0 comments on commit ea8fdc6

Please sign in to comment.