Skip to content

Commit

Permalink
python: Don't install matter_idl by default
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyDiGirolamo committed Feb 14, 2023
1 parent b3c599d commit 6468b33
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 95 deletions.
56 changes: 5 additions & 51 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -58,56 +58,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}
}

# Pigweed Python packages expected to be used in the :matter_build_venv
# target. If all packages are needed this list should match
# _pigweed_python_deps in:
# https://cs.opensource.google/pigweed/pigweed/+/master:pw_env_setup/BUILD.gn?q=_pigweed_python_deps
_pigweed_python_packages = [
"$dir_pw_allocator/py",
"$dir_pw_arduino_build/py",
"$dir_pw_bloat/py",
"$dir_pw_build/py",
"$dir_pw_build_info/py",
"$dir_pw_build_mcuxpresso/py",
"$dir_pw_cli/py",
"$dir_pw_console/py",
"$dir_pw_cpu_exception_cortex_m/py",
"$dir_pw_docgen/py",
"$dir_pw_doctor/py",
"$dir_pw_env_setup/py",
"$dir_pw_hdlc/py",
"$dir_pw_log:protos.python",
"$dir_pw_log_tokenized/py",
"$dir_pw_metric/py",
"$dir_pw_module/py",
"$dir_pw_package/py",
"$dir_pw_presubmit/py",
"$dir_pw_protobuf/py",
"$dir_pw_protobuf_compiler/py",
"$dir_pw_rpc/py",
"$dir_pw_snapshot/py:pw_snapshot",
"$dir_pw_snapshot/py:pw_snapshot_metadata",
"$dir_pw_software_update/py",
"$dir_pw_status/py",
"$dir_pw_stm32cube_build/py",
"$dir_pw_symbolizer/py",
"$dir_pw_system/py",
"$dir_pw_thread/py",
"$dir_pw_tls_client/py",
"$dir_pw_tokenizer/py",
"$dir_pw_toolchain/py",
"$dir_pw_trace/py",
"$dir_pw_trace_tokenized/py",
"$dir_pw_transfer/py",
"$dir_pw_unit_test/py",
"$dir_pw_watch/py",
]

# Matter's in-tree pw_python_package or pw_python_distribution targets.
_matter_python_packages = [
"//integrations/mobly:chip_mobly",
"//examples/chef",
"//examples/common/pigweed/rpc_console/py:chip_rpc",
"//integrations/mobly:chip_mobly",
"//scripts/py_matter_yamltests:matter_yamltests",
]

pw_python_venv("matter_build_venv") {
Expand All @@ -116,14 +72,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
requirements = pw_build_PIP_REQUIREMENTS

# Packages available to import within GN's build venv.
source_packages = _matter_python_packages + _pigweed_python_packages
source_packages = _matter_python_packages +
[ "$dir_pw_env_setup:core_pigweed_python_packages" ]
}

pw_python_pip_install("pip_install_matter_packages") {
packages = [
"//examples/common/pigweed/rpc_console:chip_rpc_distribution",
"//scripts:matter_yamltests_distribution",
]
packages = [ "//examples/common/pigweed/rpc_console:chip_rpc_distribution" ]
}

# Python packages installed during bootstrap.
Expand Down
5 changes: 3 additions & 2 deletions examples/common/pigweed/rpc_console/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ group("default") {
pw_python_distribution("chip_rpc_distribution") {
packages = [ "py:chip_rpc" ]
generate_setup_cfg = {
common_config_file = "common_setup.cfg"
name = "chip_rpc"
version = "0.0.1"
include_default_pyproject_file = true
append_date_to_version = true
}
extra_files = [ "py/pyproject.toml > pyproject.toml" ]
}

pw_internal_pip_install("pip_install_editable_chip_rpc") {
Expand Down
19 changes: 0 additions & 19 deletions examples/common/pigweed/rpc_console/common_setup.cfg

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import("$dir_pw_build/python_dist.gni")
pw_python_distribution("matter_yamltests_distribution") {
packages = [ "${chip_root}/scripts/py_matter_yamltests:matter_yamltests" ]
generate_setup_cfg = {
common_config_file = "common_setup.cfg"
name = "matter_yamltests"
version = "0.0.1"
include_default_pyproject_file = true
append_date_to_version = true
}
Expand Down
8 changes: 5 additions & 3 deletions scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,20 @@ source "$CHIP_ROOT/scripts/activate.sh"
gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging enable_pylib=$enable_pybindings enable_rtti=$enable_pybindings chip_project_config_include_dirs=[\"//config/python\"] $chip_mdns_arg $chip_case_retry_arg $pregen_dir_arg"

# Compiles python files
MATTER_YAMLTESTS_TARGET=$(gn ls "$OUTPUT_ROOT" --as=output //scripts:matter_yamltests_distribution._build_wheel)
# Check pybindings was requested
if [ "$enable_pybindings" == true ]; then
ninja -C "$OUTPUT_ROOT" pycontroller
ninja -C "$OUTPUT_ROOT" pycontroller "$MATTER_YAMLTESTS_TARGET"
else
ninja -C "$OUTPUT_ROOT" chip-repl
ninja -C "$OUTPUT_ROOT" chip-repl "$MATTER_YAMLTESTS_TARGET"
fi

if [ "$enable_pybindings" == true ]; then
WHEEL=("$OUTPUT_ROOT"/pybindings/pycontroller/pychip-*.whl)
else
WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl)
fi
WHEEL+=("$OUTPUT_ROOT"/"$(dirname "$MATTER_YAMLTESTS_TARGET")/$(basename -s .stamp "$MATTER_YAMLTESTS_TARGET")"/*.whl)

if [ "$install_wheel" = "no" ]; then
exit 0
Expand All @@ -143,7 +145,7 @@ elif [ "$install_wheel" = "separate" ]; then

source "$ENVIRONMENT_ROOT"/bin/activate
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip
"$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}"
"$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall "${WHEEL[@]}"

echo ""
echo_green "Compilation completed and WHL package installed in: "
Expand Down
19 changes: 0 additions & 19 deletions scripts/common_setup.cfg

This file was deleted.

0 comments on commit 6468b33

Please sign in to comment.