Skip to content

Include py matter idl for pytests #38482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Same for files in zap-generated folders
**/zap-generated/** linguist-generated
# And some specific generated files
src/controller/python/chip/clusters/CHIPClusters.py linguist-generated
src/controller/python/chip/clusters/Objects.py linguist-generated
src/controller/python/matter/clusters/CHIPClusters.py linguist-generated
src/controller/python/matter/clusters/Objects.py linguist-generated
# Let bat file use CRLF linebreak
**/*.bat eol=crlf
# Mark Matter operational certificate/key files as binary
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ jobs:
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
python -m ensurepip --upgrade
python -m pip install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl
python -m pip install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl
python -m pip install ./out/controller/python/chip_repl-0.0-py3-none-any.whl
python -m pip install ./out/controller/python/matter_core-1.0.0-cp37-abi3-linux_x86_64.whl
python -m pip install ./out/controller/python/matter_clusters-1.0.0-py3-none-any.whl
python -m pip install ./out/controller/python/matter_repl-1.0.0-py3-none-any.whl

- name: Run Python tests
shell: bash
Expand Down Expand Up @@ -503,7 +503,7 @@ jobs:
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: linux
bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}
bootstrap-log-name: bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }}

- name: Run Build Coverage
run: ./scripts/build_coverage.sh --yaml
4 changes: 3 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ jobs:
"
- name: Build Apps
run: |
scripts/run_in_build_env.sh './scripts/build_python.sh --install_virtual_env out/venv'
scripts/run_in_build_env.sh './scripts/build_python.sh \
--install_virtual_env out/venv\
--include_pytest_deps yes'
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT} \
Expand Down
4 changes: 2 additions & 2 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ exclude:
- "third_party/nanopb/repo/**/*"
- "examples/android/CHIPTool/gradlew" # gradle wrapper generated file
- "third_party/android_deps/gradlew" # gradle wrapper generated file
- "src/controller/python/chip/clusters/Objects.py" # generated file, no point to restyle
- "src/controller/python/chip/clusters/CHIPClusters.py" # generated file, no point to restyle
- "src/controller/python/matter/clusters/Objects.py" # generated file, no point to restyle
- "src/controller/python/matter/clusters/CHIPClusters.py" # generated file, no point to restyle
- "scripts/py_matter_idl/matter/idl/tests/outputs/**/*" # Matches generated output 1:1
- "scripts/tools/zap/tests/outputs/**/*" # Matches generated output 1:1
- "examples/chef/sample_app_util/test_files/*.yaml"
Expand Down
6 changes: 3 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"//examples/common/pigweed/rpc_console/py:chip_rpc",
"//integrations/mobly:chip_mobly",
"//scripts/py_matter_yamltests:matter_yamltests",
"//src/python_testing/matter_testing_infrastructure:chip-testing",
"//src/python_testing/matter_testing_infrastructure:matter-testing",
]

pw_python_venv("matter_build_venv") {
Expand Down Expand Up @@ -123,7 +123,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
deps = [
"${chip_root}/scripts:matter_yamltests_distribution.wheel",
"${chip_root}/src/controller/python:chip-repl",
"${chip_root}/src/python_testing/matter_testing_infrastructure:chip-testing.wheel",
"${chip_root}/src/python_testing/matter_testing_infrastructure:matter-testing.wheel",
]
}
}
Expand Down Expand Up @@ -255,7 +255,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"//scripts/py_matter_idl:matter_idl.tests",
"//scripts/py_matter_yamltests:matter_yamltests.tests",
"//src:tests_run",
"//src/python_testing/matter_testing_infrastructure:chip-testing.tests",
"//src/python_testing/matter_testing_infrastructure:matter-testing.tests",

# Platform test group locations.
"//src/platform/silabs/tests:silabs_platform_tests_run",
Expand Down
16 changes: 8 additions & 8 deletions build/chip/python_wheel.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ import("$dir_pw_build/python.gni")
import("${chip_root}/src/system/system.gni")

declare_args() {
chip_python_version = "0.0"
chip_python_package_prefix = "chip"
chip_python_version = "1.0.0"
chip_python_package_prefix = "matter"
chip_python_supports_stack_locking = chip_system_config_locking != "none"
}

template("chip_python_wheel_action") {
template("matter_python_wheel_action") {
_dist_dir = "${root_out_dir}/controller/python"

_py_manifest_file = "${target_gen_dir}/${target_name}.py_manifest.json"

pw_python_action(target_name) {
script = "build-chip-wheel.py"
script = "build-matter-wheel.py"
forward_variables_from(invoker, "*")

_py_manifest_files_rebased = []
Expand Down Expand Up @@ -62,13 +62,13 @@ template("chip_python_wheel_action") {
write_file(_py_manifest_file, _py_manifest, "json")

args = [
"--package_name",
"--package-name",
py_package_name,
"--build_number",
"--build-number",
chip_python_version,
"--build_dir",
"--build-dir",
rebase_path("${target_gen_dir}/${target_name}.py_build", root_build_dir),
"--dist_dir",
"--dist-dir",
rebase_path(_dist_dir, root_build_dir),
"--manifest",
rebase_path(_py_manifest_file, root_build_dir),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ directory:**
> </struct>
> ```

6. [src/controller/python/chip/clusters/\_\_init\_\_.py](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python/chip/clusters/__init__.py)
6. [src/controller/python/matter/clusters/\_\_init\_\_.py](https://github.com/project-chip/connectedhomeip/tree/master/src/controller/python/matter/clusters/__init__.py)

**Enable your new cluster in the Python and Android clients** in
[src/controller/data_model/controller-clusters.zap](https://github.com/project-chip/connectedhomeip/blob/master/src/controller/data_model/controller-clusters.zap)
Expand Down
32 changes: 16 additions & 16 deletions docs/development_controllers/chip-repl/Matter_Access_Control.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2025-01-29 13:22:45 ThinkPad chip.storage[2283552] ERROR [Errno 2] No such file or directory: '/tmp/repl-storage.json'\n",
"2025-01-29 13:22:45 ThinkPad chip.storage[2283552] CRITICAL Could not load configuration from /tmp/repl-storage.json - resetting configuration...\n",
"2025-01-29 13:22:45 ThinkPad chip.storage[2283552] WARNING No valid SDK configuration present - clearing out configuration\n",
"2025-01-29 13:22:45 ThinkPad chip.storage[2283552] WARNING No valid REPL configuration present - clearing out configuration\n"
"2025-01-29 13:22:45 ThinkPad matter.storage[2283552] ERROR [Errno 2] No such file or directory: '/tmp/repl-storage.json'\n",
"2025-01-29 13:22:45 ThinkPad matter.storage[2283552] CRITICAL Could not load configuration from /tmp/repl-storage.json - resetting configuration...\n",
"2025-01-29 13:22:45 ThinkPad matter.storage[2283552] WARNING No valid SDK configuration present - clearing out configuration\n",
"2025-01-29 13:22:45 ThinkPad matter.storage[2283552] WARNING No valid REPL configuration present - clearing out configuration\n"
]
},
{
Expand Down Expand Up @@ -263,7 +263,7 @@
"source": [
"%reset -f\n",
"import importlib.util\n",
"spec = importlib.util.find_spec('chip.ChipReplStartup')\n",
"spec = importlib.util.find_spec('matter.ChipReplStartup')\n",
"%run {spec.origin}"
]
},
Expand Down Expand Up @@ -395,7 +395,7 @@
"\n",
"\u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.OperationalCredentials'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;35mOperationalCredentials\u001b[0m\u001b[1;39m(\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.OperationalCredentials'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;35mOperationalCredentials\u001b[0m\u001b[1;39m(\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[1;39m(\u001b[0m\u001b[39mdata version\u001b[0m\u001b[1;39m)\u001b[0m\u001b[39m=\u001b[0m\u001b[1;36m3950260077\u001b[0m\u001b[39m,\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[33mNOCs\u001b[0m\u001b[39m=\u001b[0m\u001b[1;39m[\u001b[0m\n",
"\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mNOCStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
Expand Down Expand Up @@ -495,9 +495,9 @@
"\n",
"\u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'chip.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338779\u001b[0m\u001b[39m,\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'chip.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338779\u001b[0m\u001b[39m,\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
"\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
"\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kAdminister: \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
"\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[1m>\u001b[0m,\n",
Expand Down Expand Up @@ -562,7 +562,7 @@
}
],
"source": [
"acl = data[0][chip.clusters.Objects.AccessControl][chip.clusters.Objects.AccessControl.Attributes.Acl]\n",
"acl = data[0][matter.clusters.Objects.AccessControl][matter.clusters.Objects.AccessControl.Attributes.Acl]\n",
"acl"
]
},
Expand Down Expand Up @@ -699,9 +699,9 @@
"\n",
"\u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'chip.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338782\u001b[0m\u001b[39m,\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'chip.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338782\u001b[0m\u001b[39m,\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
"\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
"\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kAdminister: \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
"\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
Expand Down Expand Up @@ -906,9 +906,9 @@
"\n",
"\u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ \u001b[0m\u001b[1;36m0\u001b[0m: \u001b[1m{\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'chip.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'chip.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338786\u001b[0m\u001b[39m,\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'chip.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
"\u001b[2;32m│ │ \u001b[0m\u001b[1m<\u001b[0m\u001b[1;95mclass\u001b[0m\u001b[39m \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m{\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Attribute.DataVersion'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;36m318338786\u001b[0m\u001b[39m,\u001b[0m\n",
"\u001b[2;32m│ │ │ \u001b[0m\u001b[39m<class \u001b[0m\u001b[32m'matter.clusters.Objects.AccessControl.Attributes.Acl'\u001b[0m\u001b[39m>: \u001b[0m\u001b[1;39m[\u001b[0m\n",
"\u001b[2;32m│ │ │ │ \u001b[0m\u001b[1;35mAccessControlEntryStruct\u001b[0m\u001b[1;39m(\u001b[0m\n",
"\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mprivilege\u001b[0m\u001b[39m=<AccessControlEntryPrivilegeEnum.kAdminister: \u001b[0m\u001b[1;36m5\u001b[0m\u001b[39m>,\u001b[0m\n",
"\u001b[2;32m│ │ │ │ │ \u001b[0m\u001b[33mauthMode\u001b[0m\u001b[39m=<AccessControlEntryAuthModeEnum.kCase: \u001b[0m\u001b[1;36m2\u001b[0m\u001b[39m>,\u001b[0m\n",
Expand Down
Loading
Loading