Skip to content

Commit

Permalink
Fix metadata_parser python module to make it wheel buildable. (projec…
Browse files Browse the repository at this point in the history
…t-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/ (project-chip#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 <[email protected]>
  • Loading branch information
2 people authored and j-ororke committed Jul 31, 2024
1 parent 5654f85 commit 140ec48
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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:metadata_parser",
]

pw_python_venv("matter_build_venv") {
Expand Down Expand Up @@ -107,6 +108,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:metadata_parser.wheel",
]
if (enable_pylib) {
deps += [ "${chip_root}/src/pybindings/pycontroller" ]
Expand Down Expand Up @@ -234,8 +236,8 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"//scripts/build:build_examples.tests",
"//scripts/py_matter_idl:matter_idl.tests",
"//scripts/py_matter_yamltests:matter_yamltests.tests",
"//scripts/tests/py:metadata_parser.tests",
"//src:tests_run",
"//src/python_testing/matter_testing_infrastructure:metadata_parser.tests",
]

if (current_os == "linux" || current_os == "mac") {
Expand Down
3 changes: 3 additions & 0 deletions scripts/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ else
WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl)
fi

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

if [ -n "$extra_packages" ]; then
WHEEL+=("$extra_packages")
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/run_python_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import click
import coloredlogs
from colorama import Fore, Style
from py.metadata import Metadata, MetadataReader
from metadata_parser.metadata import Metadata, MetadataReader

DEFAULT_CHIP_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ pw_python_package("metadata_parser") {
inputs = [ "env_test.yaml" ]

sources = [
"__init__.py",
"metadata.py",
"metadata_parser/__init__.py",
"metadata_parser/metadata.py",
]

tests = [ "test_metadata.py" ]
tests = [ "metadata_parser/test_metadata.py" ]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
name = metadata_parser
version = 0.0.1
author = Project CHIP Authors
description = Scripts to get metadata (runner arguments) associated with the python_testing scripts
description = Scripts to get metadata (runner arguments) associated with the python_testing scripts
File renamed without changes.

0 comments on commit 140ec48

Please sign in to comment.