|
| 1 | +# Copyright (c) 2025 Project CHIP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +import("//build_overrides/build.gni") |
| 16 | +import("//build_overrides/chip.gni") |
| 17 | +import("//build_overrides/pigweed.gni") |
| 18 | +import("$dir_pw_build/python_dist.gni") |
| 19 | + |
| 20 | +idt_files = [ |
| 21 | + "${chip_root}/src/python_testing/post_certification_tests/production_device_checks.py", |
| 22 | + "${chip_root}/src/python_testing/TC_DA_1_2.py", |
| 23 | + "${chip_root}/src/python_testing/TC_DA_1_7.py", |
| 24 | +] |
| 25 | + |
| 26 | +credentials_files = [ "${chip_root}/credentials/fetch_paa_certs_from_dcl.py" ] |
| 27 | + |
| 28 | +_version = "1.4.2" |
| 29 | + |
| 30 | +pw_python_package("post-certification-tests-module") { |
| 31 | + generate_setup = { |
| 32 | + metadata = { |
| 33 | + name = "post-certification-tests-module" |
| 34 | + version = _version |
| 35 | + } |
| 36 | + } |
| 37 | + |
| 38 | + # NOTE: production_device_checks.py is included here because `sources` is |
| 39 | + # a mandatory parameter. It is also included in `extra_files` to place it |
| 40 | + # in the correct directory in the final wheel. This duplication is a known |
| 41 | + # issue due to build system limitations. |
| 42 | + sources = [ "production_device_checks.py" ] |
| 43 | +} |
| 44 | + |
| 45 | +pw_python_distribution("matter-post-certification-tests") { |
| 46 | + packages = [ ":post-certification-tests-module" ] |
| 47 | + |
| 48 | + generate_setup_cfg = { |
| 49 | + name = "matter-post-certification-tests" |
| 50 | + version = _version |
| 51 | + include_default_pyproject_file = true |
| 52 | + include_extra_files_in_package_data = true |
| 53 | + } |
| 54 | + |
| 55 | + extra_files = [] |
| 56 | + |
| 57 | + foreach(file, idt_files) { |
| 58 | + extra_files += |
| 59 | + [ "${file} > chip/testing/idt/" + get_path_info(file, "file") ] |
| 60 | + } |
| 61 | + foreach(file, credentials_files) { |
| 62 | + extra_files += [ "${file} > credentials/" + get_path_info(file, "file") ] |
| 63 | + } |
| 64 | +} |
0 commit comments