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

Python testing mypy conformance #38165

Merged

Conversation

asirko-soft
Copy link
Contributor

@asirko-soft asirko-soft commented Mar 28, 2025

Basically reusing existing mypy installation to check for a typing issues in matter testing code. Only couple of files are being checked to keep this PR small. Also added the CI workflow. Please let me know if the approach is reasonable and I can continue with keeping other files conformant in a similar fashion.

Testing

Local and CI testing

Fixes #37749

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances mypy conformance for the Python testing modules by adding new type stub (.pyi) files, updating type annotations, and introducing a CI workflow for mypy validation.

  • Added type stub files for tasks, pics, apps, and package init in the chip.testing module.
  • Updated type annotations and function signatures in testing code and tests to align with stricter type checking.
  • Introduced a GitHub Actions workflow to validate type correctness using mypy.

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/tasks.pyi Added type stubs for tasks signatures.
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/pics.pyi Added type stubs for pics functions.
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/apps.pyi Added type stubs for apps and subprocess classes.
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/init.pyi Provided a stub file for the chip.testing package.
src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py Updated wait() method’s return type for consistency with type stubs.
src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py Refined type hints and annotations in helper functions and test cases.
src/python_testing/matter_testing_infrastructure/chip/testing/pics.py Improved XML parsing by adding checks for missing elements.
.github/workflows/mypy-validation.yml Added a CI workflow for mypy validation on selected files.
Files not reviewed (1)
  • src/python_testing/matter_testing_infrastructure/mypy.ini: Language not supported

@github-actions github-actions bot added the tests label Mar 28, 2025
Copy link

github-actions bot commented Mar 28, 2025

PR #38165: Size comparison from 0b71b04 to 0c40401

Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 0b71b04 0c40401 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1098468 1098468 0 0.0
RAM 94866 94866 0 0.0
bl702 lighting-app bl702+eth FLASH 653398 653398 0 0.0
RAM 33533 33533 0 0.0
bl702+wifi FLASH 830654 830654 0 0.0
RAM 22257 22257 0 0.0
bl706+mfd+rpc+littlefs FLASH 1063158 1063158 0 0.0
RAM 32181 32181 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 893960 893960 0 0.0
RAM 26920 26920 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 976836 976836 0 0.0
RAM 24668 24668 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 818604 818604 0 0.0
RAM 120296 120296 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 827516 827516 0 0.0
RAM 125392 125392 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 774360 774360 0 0.0
RAM 113764 113764 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 758644 758644 0 0.0
RAM 113972 113972 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 541966 541966 0 0.0
RAM 205152 205152 0 0.0
lock CC3235SF_LAUNCHXL FLASH 576066 576066 0 0.0
RAM 205400 205400 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 660173 660173 0 0.0
RAM 75436 75436 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 680033 680033 0 0.0
RAM 78076 78076 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 680033 680033 0 0.0
RAM 78076 78076 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 636957 636957 0 0.0
RAM 70504 70504 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620469 620469 0 0.0
RAM 71676 71676 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 640105 640105 0 0.0
RAM 74220 74220 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 640105 640105 0 0.0
RAM 74220 74220 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 639925 639925 0 0.0
RAM 74684 74684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 659641 659641 0 0.0
RAM 77228 77228 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 659641 659641 0 0.0
RAM 77228 77228 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616265 616265 0 0.0
RAM 68772 68772 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 636125 636125 0 0.0
RAM 71412 71412 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 636125 636125 0 0.0
RAM 71412 71412 0 0.0
efr32 lock-app BRD4187C FLASH 941128 941128 0 0.0
RAM 159944 159944 0 0.0
BRD4338a FLASH 735200 735200 0 0.0
RAM 234856 234856 0 0.0
window-app BRD4187C FLASH 1033536 1033528 -8 -0.0
RAM 128048 128048 0 0.0
esp32 all-clusters-app c3devkit DRAM 103384 103384 0 0.0
FLASH 1785454 1785454 0 0.0
IRAM 83846 83846 0 0.0
m5stack DRAM 121964 121964 0 0.0
FLASH 1751930 1751930 0 0.0
IRAM 117043 117043 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2659589 2659589 0 0.0
RAM 112304 112304 0 0.0
all-clusters-app debug unknown 5584 5584 0 0.0
FLASH 6130794 6130794 0 0.0
RAM 517648 517648 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5317520 5317520 0 0.0
RAM 222616 222616 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4631416 4631416 0 0.0
RAM 201000 201000 0 0.0
camera-app debug unknown 5456 5456 0 0.0
FLASH 4693950 4693950 0 0.0
RAM 196448 196448 0 0.0
camera-controller debug unknown 5776 5776 0 0.0
FLASH 11346267 11346267 0 0.0
RAM 597408 597408 0 0.0
chip-tool debug unknown 6112 6112 0 0.0
FLASH 13366455 13366455 0 0.0
RAM 606048 606048 0 0.0
chip-tool-ipv6only arm64 unknown 22120 22120 0 0.0
FLASH 11552024 11552024 0 0.0
RAM 658728 658728 0 0.0
fabric-admin debug unknown 5800 5800 0 0.0
FLASH 11637485 11637485 0 0.0
RAM 605832 605832 0 0.0
fabric-bridge-app debug unknown 4720 4720 0 0.0
FLASH 4462368 4462368 0 0.0
RAM 188200 188200 0 0.0
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5579573 5579573 0 0.0
RAM 472064 472064 0 0.0
lighting-app debug+rpc+ui unknown 6192 6192 0 0.0
FLASH 5526017 5526017 0 0.0
RAM 205200 205200 0 0.0
lock-app debug unknown 5424 5424 0 0.0
FLASH 4698160 4698160 0 0.0
RAM 192360 192360 0 0.0
ota-provider-app debug unknown 4760 4760 0 0.0
FLASH 4320366 4320366 0 0.0
RAM 181016 181016 0 0.0
ota-requestor-app debug unknown 4712 4712 0 0.0
FLASH 4450722 4450722 0 0.0
RAM 185504 185504 0 0.0
shell debug unknown 4240 4240 0 0.0
FLASH 2958124 2958124 0 0.0
RAM 145616 145616 0 0.0
thermostat-no-ble arm64 unknown 9456 9456 0 0.0
FLASH 4147192 4147192 0 0.0
RAM 229848 229848 0 0.0
tv-app debug unknown 5752 5752 0 0.0
FLASH 5918389 5918389 0 0.0
RAM 595496 595496 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11539197 11539197 0 0.0
RAM 721840 721840 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 916320 916320 0 0.0
RAM 167447 167447 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 908992 908992 0 0.0
RAM 145691 145691 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852776 852776 0 0.0
RAM 141227 141227 0 0.0
nxp contact k32w0+release FLASH 588608 588608 0 0.0
RAM 71004 71004 0 0.0
mcxw71+release FLASH 607144 607144 0 0.0
RAM 63280 63280 0 0.0
light k32w0+release FLASH 614420 614420 0 0.0
RAM 70292 70292 0 0.0
k32w1+release FLASH 691440 691440 0 0.0
RAM 72128 72128 0 0.0
lock mcxw71+release FLASH 756896 756896 0 0.0
RAM 67692 67692 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661724 1661724 0 0.0
RAM 212336 212336 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1565692 1565692 0 0.0
RAM 208544 208544 0 0.0
light cy8ckit_062s2_43012 FLASH 1442596 1442596 0 0.0
RAM 197320 197320 0 0.0
lock cy8ckit_062s2_43012 FLASH 1471492 1471492 0 0.0
RAM 224984 224984 0 0.0
qpg lighting-app qpg6105+debug FLASH 665196 665196 0 0.0
RAM 105180 105180 0 0.0
lock-app qpg6105+debug FLASH 623664 623664 0 0.0
RAM 99792 99792 0 0.0
stm32 light STM32WB5MM-DK FLASH 461160 461160 0 0.0
RAM 141496 141496 0 0.0
telink bridge-app tl7218x FLASH 666018 666018 0 0.0
689144 689144 0 0.0
RAM 90712 90712 0 0.0
101860 101860 0 0.0
light-app-ota-compress-lzma-factory-data tl3218x FLASH 777182 777182 0 0.0
RAM 50128 50128 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 767444 767444 0 0.0
RAM 40428 40428 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 755904 755904 0 0.0
783818 783818 0 0.0
RAM 97548 97548 0 0.0
109316 109316 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 683004 683004 0 0.0
705116 705116 0 0.0
RAM 51596 51596 0 0.0
62628 62628 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711454 711454 0 0.0
741298 741298 0 0.0
RAM 73416 73416 0 0.0
85816 85816 0 0.0
light-switch-app-ota-shell-factory-data tl3218x_retention FLASH 709000 709000 0 0.0
RAM 37052 37052 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603464 603464 0 0.0
603038 603038 0 0.0
RAM 138648 138648 0 0.0
148712 148712 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 790894 790898 4 0.0
818424 818428 4 0.0
RAM 96404 96404 0 0.0
107576 107576 0 0.0
tizen all-clusters-app arm unknown 5152 5152 0 0.0
FLASH 1784016 1784016 0 0.0
RAM 94280 94280 0 0.0
chip-tool-ubsan arm unknown 11560 11560 0 0.0
FLASH 19107902 19107902 0 0.0
RAM 8356268 8356268 0 0.0

@asirko-soft asirko-soft marked this pull request as ready for review March 28, 2025 15:23
Copy link

github-actions bot commented Mar 29, 2025

PR #38165: Size comparison from 1560a87 to a5a6063

Full report (70 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, psoc6, qpg, stm32, telink, tizen)
platform target config section 1560a87 a5a6063 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1098468 1098468 0 0.0
RAM 94866 94866 0 0.0
bl702 lighting-app bl702+eth FLASH 653398 653398 0 0.0
RAM 33533 33533 0 0.0
bl702+wifi FLASH 830654 830654 0 0.0
RAM 22257 22257 0 0.0
bl706+mfd+rpc+littlefs FLASH 1063158 1063158 0 0.0
RAM 32181 32181 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 893960 893960 0 0.0
RAM 26920 26920 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 976836 976836 0 0.0
RAM 24668 24668 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 818604 818604 0 0.0
RAM 120296 120296 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 827516 827516 0 0.0
RAM 125392 125392 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 774360 774360 0 0.0
RAM 113764 113764 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 758644 758644 0 0.0
RAM 113972 113972 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 541966 541966 0 0.0
RAM 205152 205152 0 0.0
lock CC3235SF_LAUNCHXL FLASH 576066 576066 0 0.0
RAM 205400 205400 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 660173 660173 0 0.0
RAM 75436 75436 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 680033 680033 0 0.0
RAM 78076 78076 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 680033 680033 0 0.0
RAM 78076 78076 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 636957 636957 0 0.0
RAM 70504 70504 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620469 620469 0 0.0
RAM 71676 71676 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 640105 640105 0 0.0
RAM 74220 74220 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 640105 640105 0 0.0
RAM 74220 74220 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 639925 639925 0 0.0
RAM 74684 74684 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 659641 659641 0 0.0
RAM 77228 77228 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 659641 659641 0 0.0
RAM 77228 77228 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 616265 616265 0 0.0
RAM 68772 68772 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 636125 636125 0 0.0
RAM 71412 71412 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 636125 636125 0 0.0
RAM 71412 71412 0 0.0
efr32 lock-app BRD4187C FLASH 941128 941128 0 0.0
RAM 159944 159944 0 0.0
BRD4338a FLASH 735200 735200 0 0.0
RAM 234856 234856 0 0.0
window-app BRD4187C FLASH 1033536 1033528 -8 -0.0
RAM 128048 128048 0 0.0
esp32 all-clusters-app c3devkit DRAM 103384 103384 0 0.0
FLASH 1785454 1785454 0 0.0
IRAM 83846 83846 0 0.0
m5stack DRAM 121964 121964 0 0.0
FLASH 1751930 1751930 0 0.0
IRAM 117043 117043 0 0.0
linux air-purifier-app debug unknown 4752 4752 0 0.0
FLASH 2659589 2659589 0 0.0
RAM 112304 112304 0 0.0
all-clusters-app debug unknown 5584 5584 0 0.0
FLASH 6130794 6130794 0 0.0
RAM 517648 517648 0 0.0
all-clusters-minimal-app debug unknown 5456 5456 0 0.0
FLASH 5317520 5317520 0 0.0
RAM 222616 222616 0 0.0
bridge-app debug unknown 5472 5472 0 0.0
FLASH 4631416 4631416 0 0.0
RAM 201000 201000 0 0.0
camera-app debug unknown 5456 5456 0 0.0
FLASH 4693950 4693950 0 0.0
RAM 196448 196448 0 0.0
camera-controller debug unknown 5776 5776 0 0.0
FLASH 11346267 11346267 0 0.0
RAM 597408 597408 0 0.0
chip-tool debug unknown 6112 6112 0 0.0
FLASH 13366455 13366455 0 0.0
RAM 606048 606048 0 0.0
chip-tool-ipv6only arm64 unknown 22120 22120 0 0.0
FLASH 11552024 11552024 0 0.0
RAM 658728 658728 0 0.0
fabric-admin debug unknown 5800 5800 0 0.0
FLASH 11637485 11637485 0 0.0
RAM 605832 605832 0 0.0
fabric-bridge-app debug unknown 4720 4720 0 0.0
FLASH 4462368 4462368 0 0.0
RAM 188200 188200 0 0.0
fabric-sync debug unknown 4976 4976 0 0.0
FLASH 5579573 5579573 0 0.0
RAM 472064 472064 0 0.0
lighting-app debug+rpc+ui unknown 6192 6192 0 0.0
FLASH 5526017 5526017 0 0.0
RAM 205200 205200 0 0.0
lock-app debug unknown 5424 5424 0 0.0
FLASH 4698160 4698160 0 0.0
RAM 192360 192360 0 0.0
ota-provider-app debug unknown 4760 4760 0 0.0
FLASH 4320366 4320366 0 0.0
RAM 181016 181016 0 0.0
ota-requestor-app debug unknown 4712 4712 0 0.0
FLASH 4450722 4450722 0 0.0
RAM 185504 185504 0 0.0
shell debug unknown 4240 4240 0 0.0
FLASH 2958124 2958124 0 0.0
RAM 145616 145616 0 0.0
thermostat-no-ble arm64 unknown 9456 9456 0 0.0
FLASH 4147192 4147192 0 0.0
RAM 229848 229848 0 0.0
tv-app debug unknown 5752 5752 0 0.0
FLASH 5918389 5918389 0 0.0
RAM 595496 595496 0 0.0
tv-casting-app debug unknown 5320 5320 0 0.0
FLASH 11539197 11539197 0 0.0
RAM 721840 721840 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 916320 916320 0 0.0
RAM 167447 167447 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 908992 908992 0 0.0
RAM 145691 145691 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 852776 852776 0 0.0
RAM 141227 141227 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1661724 1661724 0 0.0
RAM 212336 212336 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1565692 1565692 0 0.0
RAM 208544 208544 0 0.0
light cy8ckit_062s2_43012 FLASH 1442596 1442596 0 0.0
RAM 197320 197320 0 0.0
lock cy8ckit_062s2_43012 FLASH 1471492 1471492 0 0.0
RAM 224984 224984 0 0.0
qpg lighting-app qpg6105+debug FLASH 665196 665196 0 0.0
RAM 105180 105180 0 0.0
lock-app qpg6105+debug FLASH 623664 623664 0 0.0
RAM 99792 99792 0 0.0
stm32 light STM32WB5MM-DK FLASH 461160 461160 0 0.0
RAM 141496 141496 0 0.0
telink bridge-app tl7218x FLASH 666018 666018 0 0.0
689144 689144 0 0.0
RAM 90712 90712 0 0.0
101860 101860 0 0.0
light-app-ota-compress-lzma-factory-data tl3218x FLASH 777182 777182 0 0.0
RAM 50128 50128 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 767444 767444 0 0.0
RAM 40428 40428 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 755904 755904 0 0.0
783818 783818 0 0.0
RAM 97548 97548 0 0.0
109316 109316 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 683004 683004 0 0.0
705116 705116 0 0.0
RAM 51596 51596 0 0.0
62628 62628 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 711454 711454 0 0.0
741298 741298 0 0.0
RAM 73416 73416 0 0.0
85816 85816 0 0.0
light-switch-app-ota-shell-factory-data tl3218x_retention FLASH 709000 709000 0 0.0
RAM 37052 37052 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603464 603464 0 0.0
603038 603038 0 0.0
RAM 138648 138648 0 0.0
148712 148712 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 790894 790898 4 0.0
818424 818428 4 0.0
RAM 96404 96404 0 0.0
107576 107576 0 0.0
tizen all-clusters-app arm unknown 5152 5152 0 0.0
FLASH 1784016 1784016 0 0.0
RAM 94280 94280 0 0.0
chip-tool-ubsan arm unknown 11560 11560 0 0.0
FLASH 19107902 19107902 0 0.0
RAM 8356268 8356268 0 0.0

Copy link
Contributor

@khodya khodya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left little comments

@asirko-soft asirko-soft requested a review from Copilot April 2, 2025 15:51
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds type annotations and stubs for matter testing code to ensure mypy conformance while also introducing a new CI workflow for type validation.

  • Introduces type stub files for tasks, pics, and apps under chip/typings
  • Updates type hints and error reporting in testing code (tasks.py, taglist_and_topology_test.py, pics.py)
  • Adds a GitHub Actions workflow to run mypy on a subset of files

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/tasks.pyi Added type stubs for subprocess tasks
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/pics.pyi Added type stubs for pics functions
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/apps.pyi Added type stubs for app server subprocess classes
src/python_testing/matter_testing_infrastructure/chip/typings/chip/testing/init.pyi Created package stub for chip.testing
src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py Updated return type of the wait method for improved type checking
src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py Enhanced type annotations, added type ignore comments where necessary, and standardized type hints
src/python_testing/matter_testing_infrastructure/chip/testing/pics.py Improved error messages during XML parsing with robust checks for missing elements/text
.github/workflows/mypy-validation.yml Added a new CI workflow to run mypy validation on selected testing files
Files not reviewed (1)
  • src/python_testing/matter_testing_infrastructure/mypy.ini: Language not supported

@mergify mergify bot merged commit 0e08ff1 into project-chip:master Apr 3, 2025
73 checks passed
soares-sergio pushed a commit to soares-sergio/connectedhomeip that referenced this pull request Apr 8, 2025
* mypy type stubs for apps and tasks

* fix mypy warnings in taglist_and_topology_test.py

* fix mypy warnings in pics.py

* gh action yml

* gh workflow update

* run mypy from python env

* debug

* fix filename

* resolve mypy warnings in taglist file

* ignore mypy warning

* linter fixes

* lint fix 2

* resolve review comments
sayondeep pushed a commit to sayondeep/connectedhomeip that referenced this pull request Apr 10, 2025
* mypy type stubs for apps and tasks

* fix mypy warnings in taglist_and_topology_test.py

* fix mypy warnings in pics.py

* gh action yml

* gh workflow update

* run mypy from python env

* debug

* fix filename

* resolve mypy warnings in taglist file

* ignore mypy warning

* linter fixes

* lint fix 2

* resolve review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mypy conformance for python testing framework
4 participants