Skip to content

Commit

Permalink
[python] Remove dependency only used in testing (#26727)
Browse files Browse the repository at this point in the history
* [python] Remove dependency only used in testing

PR #21567 added mobly as a default dependency of the Python Core CHIP
library. The mobly package is only used by the Python testing framework
in `src/python_testing/`. Allow to install extra dependency via
`script/build_python.sh` flag and install them only when needed.

* [python] remove now unnecessary dependency mobly

* Apply restyle changes
  • Loading branch information
agners authored and pull[bot] committed Dec 15, 2023
1 parent d2cb650 commit 1052008
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ jobs:
- name: Build Python REPL and example apps
timeout-minutes: 50
run: |
scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env'
scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env --extra_packages "mobly"'
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \
Expand Down
9 changes: 9 additions & 0 deletions scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Input Options:
no: Do not install
build-env: install to virtual env for build matter
separate: install to another virtual env (out/python_env)
--extra_packages PACKAGES Install extra Python packages from PyPI
--include_yamltests Whether to install the matter_yamltests wheel.
-z --pregen_dir DIRECTORY Directory where generated zap files have been pre-generated.
"
Expand Down Expand Up @@ -96,6 +97,10 @@ while (($#)); do
install_wheel=$2
shift
;;
--extra_packages)
extra_packages=$2
shift
;;
--include_yamltests)
include_yamltests="yes"
;;
Expand Down Expand Up @@ -160,6 +165,10 @@ if [ -n "$include_yamltests" ]; then
)
fi

if [ -n "$extra_packages" ]; then
WHEEL+=("$extra_packages")
fi

if [ "$install_wheel" = "no" ]; then
exit 0
elif [ "$install_wheel" = "separate" ]; then
Expand Down
2 changes: 0 additions & 2 deletions src/controller/python/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ chip_python_wheel_action("chip-core") {
"pyyaml",
"ipdb",
"deprecation",
"mobly",
"cryptography",
"ecdsa",
]
Expand Down Expand Up @@ -428,7 +427,6 @@ chip_python_wheel_action("chip-repl") {
"ipython!=8.1.0",
"rich",
"ipykernel",
"mobly",
]

if (current_os == "mac") {
Expand Down

0 comments on commit 1052008

Please sign in to comment.