Add TigrblApp/TigrblApi mount_openrpc & mount_lens methods and simplify mount_openrpc signature #4958
+123
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
TigrblAppandTigrblApifor mounting OpenRPC and Lens endpoints to improve ergonomics and parity withmount_jsonrpc.Description
mount_openrpcintigrbl/system/docs/openrpc.pyto acceptrouter: Any | None = Noneand to default the target router to the providedapiwhenrouteris not supplied, returning the target router.mount_openrpc(...)andmount_lens(...)instance methods toTigrblApp(tigrbl/app/tigrbl_app.py) that delegate to the module-level mount functions.mount_openrpc(...)andmount_lens(...)instance methods toTigrblApi(tigrbl/api/tigrbl_api.py) that delegate to the module-level mount functions.tigrbl_teststo use the simplified functional API (mount_openrpc(app, path=...)) and added new tests exercising the bound instance methods for bothTigrblAppandTigrblApiformount_openrpcandmount_lens.Testing
uv run --directory standards --package tigrbl ruff format .anduv run --directory standards --package tigrbl ruff check . --fix, and for the tests package withuv run --directory standards --package tigrbl-tests ruff format .anduv run --directory standards --package tigrbl-tests ruff check . --fix; all checks passed.uv run --package tigrbl-tests --directory standards pytest tigrbl_tests/tests/i9n/test_mountable_openrpc_uvicorn.py tigrbl_tests/tests/i9n/test_mountable_lens_uvicorn.pyand they passed.tigrbl_testssuite withuv run --package tigrbl-tests --directory standards pytest tigrbl_tests/testsand observed successful results:934 passed, 14 skipped, 4 xfailed.Codex Task