[multi-lora] 1/n - 2, ci: verify import targets in the source-resolution harness step - #2725
[multi-lora] 1/n - 2, ci: verify import targets in the source-resolution harness step#2725yushengsu-thu wants to merge 2 commits into
Conversation
Statically resolves every miles-internal import site (including function-local ones) against the tree and imports all modules of optional namespaces when they are present, so moved or deleted modules fail fast in CPU CI instead of at runtime.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Move the import-integrity checks out of the fast suite and into tests/ci/verify_source_resolution.py, which every CPU and GPU CI job runs before pytest: statically resolve every miles-internal import site (including function-local ones) across miles/ and examples/, walk the optional namespaces in full when present, and import the update_weight lazy-import targets. Failures raise RuntimeError with the offending file:line and import target.
|
I think this PR should be narrowed to the third motivation only: protecting The current change mixes three concerns: repo-wide AST linting, optional-namespace import smoke tests, and Suggested minimal cut:
I would remove the repo-wide |
Extends
tests/ci/verify_source_resolution.py— the pre-test step every CPU and GPU CI job already runs — with import-integrity checks: statically resolve every miles-internal import site (module-level, function-local, and relative) acrossmiles/andexamples/against the source tree, walk the optional multi-lora namespaces in full when present (absent packages skip cleanly on main), and import theupdate_weight/lazy-import targets. Failures raiseRuntimeErrorwith the offendingfile:lineand import target; missing non-miles optional deps stay tolerated.Running this in the harness step instead of a fast test covers every job (CPU and GPU) before pytest even starts, which is broader than the fast suite. Born from the
mixin.pydead lazy-import incident, where a moved module was only referenced from a function-local import and nothing failed until runtime.Extracted from #2273; the stack rebases after this merges.