Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions mip-split.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
32 changes: 32 additions & 0 deletions tests/test_mip_split.py
Original file line number Diff line number Diff line change
@@ -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()
Loading