From 9d50306325a8b2a4eee9a25054fe2331564109cf Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Tue, 10 Nov 2026 09:32:41 -0600 Subject: [PATCH] ci: a stub or the stub test runs the interpreter build --- tests/test_ci_scope.py | 6 ++++-- tools/ci_scope.py | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test_ci_scope.py b/tests/test_ci_scope.py index 532616a..ad1a1bd 100644 --- a/tests/test_ci_scope.py +++ b/tests/test_ci_scope.py @@ -39,8 +39,10 @@ def test_a_workflow_reaches_its_own_jobs(self): self.assertEqual(self.jobs(".github/workflows/lint.yml"), {"lint"}) self.assertEqual(self.jobs(".github/workflows/prepare-release.yml"), set()) - def test_a_stub_reaches_the_tests_and_the_wheel_not_the_firmware_build(self): - self.assertEqual(self.jobs("src/audiometer/audiometer.pyi"), {"unit", "wheels"}) + def test_a_stub_reaches_the_tests_the_wheel_and_the_interpreter_build(self): + # The comparison with the MicroPython module runs only in the build. + self.assertEqual(self.jobs("src/audiometer/audiometer.pyi"), {"unit", "wheels", "build"}) + self.assertEqual(self.jobs("tests/test_stubs_match_modules.py"), {"lint", "unit", "build"}) self.assertEqual(self.jobs(".github/workflows/stubs.yml"), set()) def test_the_sources_packaging_and_unknown_files_reach_everything(self): diff --git a/tools/ci_scope.py b/tools/ci_scope.py index ca6c539..ebc3916 100644 --- a/tools/ci_scope.py +++ b/tools/ci_scope.py @@ -51,8 +51,12 @@ (".github/workflows/publish-release-packages.yml", ()), (".github/workflows/tag-release.yml", ()), # A type stub reaches the wheel, which carries it, and the test that holds - # it to its module. The Stubs workflow runs mypy over it on its own. - ("src/*/*.pyi", ("unit", "wheels")), + # it to its module. That test compares every stub with the module built + # into MicroPython, and the interpreter build is the only job that has one, + # so a stub or the test also reaches "build". The Stubs workflow runs mypy + # over a stub on its own. + ("src/*/*.pyi", ("unit", "wheels", "build")), + ("tests/test_stubs_match_modules.py", ("lint", "unit", "build")), # flake8 reads the examples; nothing else does. ("examples/**", ("lint",)), (".flake8", ("lint",)),