Skip to content

Commit 95bf668

Browse files
Fix metadata_parser python module to make it wheel buildable. (project-chip#34322)
* Fix the metadata module to make the wheel buildable * Added the fix for metadata import * Added fixes as per module build for metadata_testing_infrastructure * Restyled by shfmt * Make CI checks run * Update build_python.sh * Delete admin_storage.json * Make metadata_parser python module wheel buildable within src/python_testing/matter_testing_infrastructure/ (#1) * Adding metadata buildable wheel to src/python_testing/matter_testing_infrastructure * Update build_python.sh * Delete src/python_testing/matter_testing_infrastructure/build/lib/metadata_parser directory --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent a313194 commit 95bf668

File tree

11 files changed

+11
-6
lines changed

11 files changed

+11
-6
lines changed

BUILD.gn

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
6767
"//examples/common/pigweed/rpc_console/py:chip_rpc",
6868
"//integrations/mobly:chip_mobly",
6969
"//scripts/py_matter_yamltests:matter_yamltests",
70+
"//src/python_testing/matter_testing_infrastructure:metadata_parser",
7071
]
7172

7273
pw_python_venv("matter_build_venv") {
@@ -107,6 +108,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
107108
deps = [
108109
"${chip_root}/scripts:matter_yamltests_distribution.wheel",
109110
"${chip_root}/src/controller/python:chip-repl",
111+
"${chip_root}/src/python_testing/matter_testing_infrastructure:metadata_parser.wheel",
110112
]
111113
if (enable_pylib) {
112114
deps += [ "${chip_root}/src/pybindings/pycontroller" ]
@@ -234,8 +236,8 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
234236
"//scripts/build:build_examples.tests",
235237
"//scripts/py_matter_idl:matter_idl.tests",
236238
"//scripts/py_matter_yamltests:matter_yamltests.tests",
237-
"//scripts/tests/py:metadata_parser.tests",
238239
"//src:tests_run",
240+
"//src/python_testing/matter_testing_infrastructure:metadata_parser.tests",
239241
]
240242

241243
if (current_os == "linux" || current_os == "mac") {

scripts/build_python.sh

+3
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ else
212212
WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl)
213213
fi
214214

215+
# Add the matter_testing_infrastructure wheel
216+
WHEEL+=("$OUTPUT_ROOT"/python/obj/src/python_testing/matter_testing_infrastructure/metadata_parser._build_wheel/metadata_parser-*.whl)
217+
215218
if [ -n "$extra_packages" ]; then
216219
WHEEL+=("$extra_packages")
217220
fi

scripts/tests/run_python_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import click
3333
import coloredlogs
3434
from colorama import Fore, Style
35-
from py.metadata import Metadata, MetadataReader
35+
from metadata_parser.metadata import Metadata, MetadataReader
3636

3737
DEFAULT_CHIP_ROOT = os.path.abspath(
3838
os.path.join(os.path.dirname(__file__), '..', '..'))

scripts/tests/py/BUILD.gn src/python_testing/matter_testing_infrastructure/BUILD.gn

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ pw_python_package("metadata_parser") {
2828
inputs = [ "env_test.yaml" ]
2929

3030
sources = [
31-
"__init__.py",
32-
"metadata.py",
31+
"metadata_parser/__init__.py",
32+
"metadata_parser/metadata.py",
3333
]
3434

35-
tests = [ "test_metadata.py" ]
35+
tests = [ "metadata_parser/test_metadata.py" ]
3636
}

scripts/tests/py/setup.cfg src/python_testing/matter_testing_infrastructure/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
name = metadata_parser
1717
version = 0.0.1
1818
author = Project CHIP Authors
19-
description = Scripts to get metadata (runner arguments) associated with the python_testing scripts
19+
description = Scripts to get metadata (runner arguments) associated with the python_testing scripts

0 commit comments

Comments
 (0)