From 1369588bc55dab7d1833b5d68be6d469eecc74f3 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 14 Feb 2023 19:20:26 +0100 Subject: [PATCH] [python] move BlueZ/CoreBluetooth to chip-repl package (#25055) * [python] move BlueZ/CoreBluetooth to chip-repl package Move BlueZ and CoreBluetooth classes and its dependencies to the chip-repl package. This removes dependencies from the chip-core wheel and also makes sure that all dependencies are present for BlueZ (including python-dbus). It partially reverts remove unused python-dbus (#23564). * Restyled by gn --------- Co-authored-by: Restyled.io --- src/controller/python/BUILD.gn | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/controller/python/BUILD.gn b/src/controller/python/BUILD.gn index b1b7cdbd6310cc..82bc6732175a0a 100644 --- a/src/controller/python/BUILD.gn +++ b/src/controller/python/BUILD.gn @@ -196,7 +196,6 @@ chip_python_wheel_action("chip-core") { "chip/ChipBleUtility.py", "chip/ChipBluezMgr.py", "chip/ChipCommissionableNodeCtrl.py", - "chip/ChipCoreBluetoothMgr.py", "chip/ChipStack.py", "chip/FabricAdmin.py", "chip/__init__.py", @@ -238,11 +237,7 @@ chip_python_wheel_action("chip-core") { ] if (chip_controller) { - sources += [ - "chip-device-ctrl.py", - "chip-repl.py", - "chip/ChipDeviceCtrl.py", - ] + sources += [ "chip/ChipDeviceCtrl.py" ] } else { sources += [ "chip/server/__init__.py", @@ -306,12 +301,6 @@ chip_python_wheel_action("chip-core") { "ecdsa", ] - if (current_os == "mac") { - py_package_reqs += [ "pyobjc-framework-corebluetooth" ] - } else if (current_os == "linux") { - py_package_reqs += [ "pygobject" ] - } - if (current_cpu == "x64") { cpu_tag = "x86_64" } else if (current_cpu == "arm64" && current_os == "linux") { @@ -395,7 +384,11 @@ chip_python_wheel_action("chip-repl") { py_manifest_files = [ { src_dir = "." - sources = [ "chip/ChipReplStartup.py" ] + sources = [ + "chip/ChipBluezMgr.py", + "chip/ChipCoreBluetoothMgr.py", + "chip/ChipReplStartup.py", + ] sources += py_scripts }, { @@ -424,6 +417,15 @@ chip_python_wheel_action("chip-repl") { "mobly", ] + if (current_os == "mac") { + py_package_reqs += [ "pyobjc-framework-corebluetooth" ] + } else if (current_os == "linux") { + py_package_reqs += [ + "dbus-python==1.2.18", + "pygobject", + ] + } + py_package_name = "${chip_python_package_prefix}-repl" py_package_output = string_replace(py_package_name, "-", "_") py_platform_tag = "any"