Skip to content
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

Fix metadata_parser python module to make it wheel buildable. #34322

Merged
merged 9 commits into from
Jul 26, 2024
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",
"//scripts/tests/py:matter_testing_infrastructure",
]

pw_python_venv("matter_build_venv") {
Expand Down Expand Up @@ -106,6 +107,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
if (chip_enable_python_modules) {
deps = [
"${chip_root}/scripts:matter_yamltests_distribution.wheel",
"${chip_root}/scripts/tests/py:matter_testing_infrastructure.wheel",
"${chip_root}/src/controller/python:chip-repl",
]
if (enable_pylib) {
Expand Down Expand Up @@ -232,7 +234,7 @@ 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",
"//scripts/tests/py:matter_testing_infrastructure.tests",
"//src:tests_run",
]

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/scripts/tests/py/matter_testing_infrastructure._build_wheel/matter_testing_infrastructure-*.whl)

if [ -n "$extra_packages" ]; then
WHEEL+=("$extra_packages")
fi
Expand Down
8 changes: 4 additions & 4 deletions scripts/tests/py/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/python.gni")

pw_python_package("metadata_parser") {
pw_python_package("matter_testing_infrastructure") {
setup = [
"setup.py",
"setup.cfg",
Expand All @@ -28,9 +28,9 @@ pw_python_package("metadata_parser") {
inputs = [ "env_test.yaml" ]

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

tests = [ "test_metadata.py" ]
tests = [ "matter_testing_infrastructure/test_metadata.py" ]
}
4 changes: 2 additions & 2 deletions scripts/tests/py/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

[metadata]
name = metadata_parser
name = matter_testing_infrastructure
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
2 changes: 1 addition & 1 deletion scripts/tests/py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


"""The metadata_parser package."""
"""The matter_testing_infrastructure package."""

import setuptools # type: ignore

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
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
from matter_testing_infrastructure.metadata import Metadata, MetadataReader

DEFAULT_CHIP_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..'))
Expand Down