diff --git a/mip-split.toml b/mip-split.toml index 0d3f4004..d2540a4f 100644 --- a/mip-split.toml +++ b/mip-split.toml @@ -58,15 +58,19 @@ host-only = [ ] [multimer] -# `librt` is `timer_create` through ctypes/ffi, i.e. Linux. The asyncio pieces -# (`_async_timer`, `_asyncio_loader`, `_mpasyncio`, `_schedule`) are portable and -# stay with `machine`, `polling`, `_ticks` and `_core`. +# The wake sources and the REPL hook that only a desktop, phone or browser +# host can use: `_inputhook` (CPython's PyOS_InputHook), `_src_pending` +# (CPython's worker thread + Py_AddPendingCall), `_src_signal` (POSIX timer +# signals: CPython and unix MicroPython), `_src_native` (the windows port's +# `_timing` helper) and `_src_wasm` (the browser). Boards keep the dispatcher, +# `_hostloop`, `_repl`, `_ticks`, `_src_machine`, `_src_none`, `_src_asyncio` +# and the asyncio loaders. host-only = [ - "librt", - "sdl2", - "threading", - "wasm", - "win32", + "_inputhook", + "_src_native", + "_src_pending", + "_src_signal", + "_src_wasm", ] [bledev] diff --git a/tests/test_mip_split.py b/tests/test_mip_split.py new file mode 100644 index 00000000..3b275fb8 --- /dev/null +++ b/tests/test_mip_split.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2026 Brad Barnett +# +# SPDX-License-Identifier: MIT +"""mip-split.toml names only modules that exist under lib/. + +The MIP index sync refuses a release whose mip-split.toml names a module +that isn't on disk, and it only runs after the tag exists (v0.6.0 failed +that way, #103). This catches it in the pull request instead. +""" + +import pathlib +import tomllib +import unittest + +ROOT = pathlib.Path(__file__).resolve().parent.parent + + +class TestMipSplit(unittest.TestCase): + def test_host_only_names_exist(self): + split = tomllib.loads((ROOT / "mip-split.toml").read_text(encoding="utf-8")) + for package, section in split.items(): + package_dir = ROOT / "lib" / package + with self.subTest(package=package): + self.assertTrue(package_dir.is_dir(), f"lib/{package} does not exist") + missing = sorted( + name for name in section.get("host-only", ()) if not (package_dir / f"{name}.py").is_file() + ) + self.assertEqual(missing, [], f"[{package}] host-only names modules that don't exist") + + +if __name__ == "__main__": + unittest.main()