Repository navigation
fix: expose bridge boot methods to type checkers - #1981
Conversation
|
@koriyoshi2041 Can you please rebase this to |
6a6177a to
56f572b
Compare
|
Rebased onto |
|
Correction to my earlier status note: the delayed MPS runner finished with four failures in I checked this against the current This PR changes only |
|
@koriyoshi2041 That is correct, I am investigating that now as part of the v4.4.0 release. Once that release is out, you'll need to rebase to In the future, be sure to base your PRs on |
|
@koriyoshi2041 The bug fix is now on |
56f572b to
b7fd43c
Compare
|
Rebased onto the post-release |
Problem
TransformerBridge.boot_transformers,boot_native, andboot_tl_legacyare attached at runtime, so typed callers cannot see the full public API. The existing declaration only coversboot_transformersasCallable[..., TransformerBridge], which also discards its parameter types.Fix
Declare all three static methods under
TYPE_CHECKINGwith signatures matching their source implementations. This preserves the existing bridge-to-sources import direction and does not change runtime behavior.Test
uvx ty check typed_boot_check.pyagainst calls to all three methods; each return type is revealed asTransformerBridgeuv run mypy transformer_lens/model_bridge/transformer_bridge.pyuv run pytest tests/unit/model_bridge/test_boot_native.py -q(72 passed)inspect.signaturecheck for all three attached methodsgit diff --checkRisk
Low. The declarations are excluded at runtime. The only maintenance risk is signature drift if a source boot function changes; keeping the declarations next to the bridge API makes that mismatch visible to static checks and review.
Closes #1980.