Skip to content

Commit 2517027

Browse files
Alami-Amineaustina-csa
authored andcommitted
Remove pybindings from stack (project-chip#34892)
* remove pybindings sourcecode * remove code that interacts with pybinding * removing pybind11 submodule
1 parent f9f92b3 commit 2517027

File tree

14 files changed

+10
-606
lines changed

14 files changed

+10
-606
lines changed

.github/dependabot.yml

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ updates:
5454
- dependency-name: "third_party/open-iot-sdk/repo"
5555
- dependency-name: "third_party/ot-br-posix/repo"
5656
- dependency-name: "third_party/perfetto/repo"
57-
- dependency-name: "third_party/pybind11/repo"
5857
- dependency-name: "third_party/qpg_sdk/repo"
5958
- dependency-name: "third_party/silabs/repo"
6059
- dependency-name: "third_party/simw-top-mini/repo"

.github/workflows/build.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ jobs:
308308

309309
- name: Setup Build, Run Build and Run Tests
310310
run: |
311-
scripts/build/gn_gen.sh --args="enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false"
311+
scripts/build/gn_gen.sh --args="enable_rtti=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false"
312312
scripts/run_in_build_env.sh "ninja -C ./out"
313313
scripts/tests/gn_tests.sh
314314
- name: Setup test python environment
@@ -414,7 +414,6 @@ jobs:
414414
# "host clang" build, which uses the pigweed
415415
# clang.
416416
"default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';;
417-
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';;
418417
esac
419418
BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands
420419
scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE"

.gitmodules

-4
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@
165165
path = third_party/infineon/psoc6/psoc6_sdk/libs/recipe-make-cat1a
166166
url = https://github.com/Infineon/recipe-make-cat1a
167167
platforms = infineon
168-
[submodule "third_party/pybind11/repo"]
169-
path = third_party/pybind11/repo
170-
url = https://github.com/pybind/pybind11
171-
branch = stable
172168
[submodule "p6/lwip"]
173169
path = third_party/infineon/psoc6/psoc6_sdk/libs/lwip
174170
url = https://github.com/lwip-tcpip/lwip.git

BUILD.gn

-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
4444
chip_enable_python_modules =
4545
(current_os == "mac" || current_os == "linux") &&
4646
(host_cpu == "x64" || host_cpu == "arm64" || host_cpu == "arm")
47-
enable_pylib = false
4847

4948
# Build the Linux all clusters app example with default group
5049
chip_build_all_clusters_app = false
@@ -112,9 +111,6 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
112111
"${chip_root}/src/controller/python:chip-repl",
113112
"${chip_root}/src/python_testing/matter_testing_infrastructure:metadata_parser.wheel",
114113
]
115-
if (enable_pylib) {
116-
deps += [ "${chip_root}/src/pybindings/pycontroller" ]
117-
}
118114
}
119115
}
120116

@@ -214,9 +210,6 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
214210
data_deps = [ "${chip_root}/examples/chip-tool" ]
215211

216212
if (chip_enable_python_modules) {
217-
if (enable_pylib) {
218-
data_deps += [ "${chip_root}/src/pybindings/pycontroller" ]
219-
}
220213
data_deps += [ "${chip_root}/src/controller/python:chip-repl" ]
221214
}
222215

scripts/build_python.sh

+4-19
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ OUTPUT_ROOT="$CHIP_ROOT/out/python_lib"
3939

4040
declare enable_ble=true
4141
declare chip_detail_logging=false
42-
declare enable_pybindings=false
4342
declare chip_mdns
4443
declare case_retry_delta
4544
declare install_virtual_env
@@ -49,7 +48,7 @@ declare install_jupyterlab=no
4948

5049
help() {
5150

52-
echo "Usage: $file_name [ options ... ] [ -chip_detail_logging ChipDetailLoggingValue ] [ -chip_mdns ChipMDNSValue ] [-enable_pybindings EnableValue]"
51+
echo "Usage: $file_name [ options ... ] [ -chip_detail_logging ChipDetailLoggingValue ] [ -chip_mdns ChipMDNSValue ]"
5352

5453
echo "General Options:
5554
-h, --help Display this information.
@@ -59,8 +58,6 @@ Input Options:
5958
By default it is false.
6059
-m, --chip_mdns ChipMDNSValue Specify ChipMDNSValue as platform or minimal.
6160
By default it is minimal.
62-
-p, --enable_pybindings <true/false> Specify whether to enable pybindings as python controller.
63-
6461
-t --time_between_case_retries MRPActiveRetryInterval Specify MRPActiveRetryInterval value
6562
Default is 300 ms
6663
-i, --install_virtual_env <path> Create a virtual environment with the wheels installed
@@ -104,14 +101,6 @@ while (($#)); do
104101
chip_mdns=$2
105102
shift
106103
;;
107-
--enable_pybindings | -p)
108-
enable_pybindings=$2
109-
if [[ "$enable_pybindings" != "true" && "$enable_pybindings" != "false" ]]; then
110-
echo "enable_pybindings should have a true/false value, not '$enable_pybindings'"
111-
exit
112-
fi
113-
shift
114-
;;
115104
--time_between_case_retries | -t)
116105
chip_case_retry_delta=$2
117106
shift
@@ -157,7 +146,7 @@ while (($#)); do
157146
done
158147

159148
# Print input values
160-
echo "Input values: chip_detail_logging = $chip_detail_logging , chip_mdns = \"$chip_mdns\", enable_pybindings = $enable_pybindings, chip_case_retry_delta=\"$chip_case_retry_delta\", pregen_dir=\"$pregen_dir\", enable_ble=\"$enable_ble\""
149+
echo "Input values: chip_detail_logging = $chip_detail_logging , chip_mdns = \"$chip_mdns\", chip_case_retry_delta=\"$chip_case_retry_delta\", pregen_dir=\"$pregen_dir\", enable_ble=\"$enable_ble\""
161150

162151
# Ensure we have a compilation environment
163152
source "$CHIP_ROOT/scripts/activate.sh"
@@ -184,7 +173,7 @@ export SYSTEM_VERSION_COMPAT=0
184173
# Make all possible human redable tracing available.
185174
tracing_options="matter_log_json_payload_hex=true matter_log_json_payload_decode_full=true matter_enable_tracing_support=true"
186175

187-
gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="$tracing_options 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 chip_config_network_layer_ble=$enable_ble chip_enable_ble=$enable_ble chip_crypto=\"boringssl\""
176+
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\""
188177

189178
function ninja_target() {
190179
# Print the ninja target required to build a gn label.
@@ -206,11 +195,7 @@ function wheel_output_dir() {
206195
ninja -C "$OUTPUT_ROOT" python_wheels
207196

208197
# Add wheels from chip_python_wheel_action templates.
209-
if [ "$enable_pybindings" == true ]; then
210-
WHEEL=("$OUTPUT_ROOT"/pybindings/pycontroller/pychip-*.whl)
211-
else
212-
WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl)
213-
fi
198+
WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl)
214199

215200
# Add the matter_testing_infrastructure wheel
216201
WHEEL+=("$OUTPUT_ROOT"/python/obj/src/python_testing/matter_testing_infrastructure/metadata_parser._build_wheel/metadata_parser-*.whl)

scripts/build_python_device.sh

+5-20
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ OUTPUT_ROOT="$CHIP_ROOT/out/python_lib"
3939
ENVIRONMENT_ROOT="$CHIP_ROOT/out/python_env"
4040

4141
declare chip_detail_logging=false
42-
declare enable_pybindings=false
4342
declare chip_mdns
4443

4544
help() {
4645

47-
echo "Usage: $file_name [ options ... ] [ -chip_detail_logging ChipDetailLoggingValue ] [ -chip_mdns ChipMDNSValue ] [-enable_pybindings EnableValue]"
46+
echo "Usage: $file_name [ options ... ] [ -chip_detail_logging ChipDetailLoggingValue ] [ -chip_mdns ChipMDNSValue ]"
4847

4948
echo "General Options:
5049
-h, --help Display this information.
@@ -53,7 +52,6 @@ Input Options:
5352
By default it is false.
5453
-m, --chip_mdns ChipMDNSValue Specify ChipMDNSValue as platform or minimal.
5554
By default it is minimal.
56-
-p, --enable_pybindings EnableValue Specify whether to enable pybindings as python controller.
5755
"
5856
}
5957

@@ -73,10 +71,6 @@ while (($#)); do
7371
chip_mdns=$2
7472
shift
7573
;;
76-
--enable_pybindings | -p)
77-
enable_pybindings=$2
78-
shift
79-
;;
8074
-*)
8175
help
8276
echo "Unknown Option \"$1\""
@@ -87,7 +81,7 @@ while (($#)); do
8781
done
8882

8983
# Print input values
90-
echo "Input values: chip_detail_logging = $chip_detail_logging , chip_mdns = \"$chip_mdns\", enable_pybindings = $enable_pybindings"
84+
echo "Input values: chip_detail_logging = $chip_detail_logging , chip_mdns = \"$chip_mdns\""
9185

9286
# Ensure we have a compilation environment
9387
source "$CHIP_ROOT/scripts/activate.sh"
@@ -97,26 +91,17 @@ source "$CHIP_ROOT/scripts/activate.sh"
9791

9892
chip_data_model_arg="chip_data_model=\"///examples/lighting-app/lighting-common\""
9993

100-
gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging enable_pylib=$enable_pybindings enable_rtti=$enable_pybindings $chip_mdns_arg chip_controller=false $chip_data_model_arg"
94+
gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging $chip_mdns_arg chip_controller=false $chip_data_model_arg"
10195

10296
# Compiles python files
103-
# Check pybindings was requested
104-
if [ "$enable_pybindings" == true ]; then
105-
ninja -v -C "$OUTPUT_ROOT" pycontroller
106-
else
107-
ninja -v -C "$OUTPUT_ROOT" chip-core
108-
fi
97+
ninja -v -C "$OUTPUT_ROOT" chip-core
10998

11099
# Create a virtual environment that has access to the built python tools
111100
virtualenv --clear "$ENVIRONMENT_ROOT"
112101

113102
# Activate the new environment to register the python WHL
114103

115-
if [ "$enable_pybindings" == true ]; then
116-
WHEEL=("$OUTPUT_ROOT"/pybindings/pycontroller/pychip-*.whl)
117-
else
118-
WHEEL=("$OUTPUT_ROOT"/controller/python/chip_core*.whl)
119-
fi
104+
WHEEL=("$OUTPUT_ROOT"/controller/python/chip_core*.whl)
120105

121106
source "$ENVIRONMENT_ROOT"/bin/activate
122107
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip

scripts/tools/check_includes_config.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
'/java/',
3030
'/Jni',
3131
'/mock/',
32-
'/pybindings/',
3332
'/python/',
3433
'/Test',
3534
'/tests/',

src/pybindings/pycontroller/BUILD.gn

-175
This file was deleted.

0 commit comments

Comments
 (0)