Add runanywhere-python: Python SDK (pybind11 over the rac_* C ABI)#575
Add runanywhere-python: Python SDK (pybind11 over the rac_* C ABI)#575AmanSwar wants to merge 187 commits into
Conversation
|
@coderabbitai please review this PR |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sdk/runanywhere-python/LICENSE`:
- Around line 310-316: Remove the duplicate trailing MIT-style disclaimer from
sdk/runanywhere-python/LICENSE, or reconcile it into the existing Apache 2.0
warranty and liability language in Part III. Preserve one canonical disclaimer
and ensure the final license structure is consistent before release.
In `@sdk/runanywhere-python/runanywhere/download.py`:
- Line 255: Update the __slots__ declaration in the relevant class to list its
slot names in natural alphabetical order, resolving Ruff RUF023 while preserving
the existing slot names.
- Around line 288-291: In the download completion cleanup within the surrounding
function, call state.event.set() before acquiring _IN_FLIGHT_LOCK and removing
dest from _IN_FLIGHT. Preserve the existing cleanup and signaling behavior while
ensuring waiters observe completion before another caller can claim the
destination.
In `@sdk/runanywhere-python/runanywhere/events.py`:
- Around line 98-103: Update the listener exception handler in the event
dispatch logic to log caught Exception instances without including or
serializing the event payload. Retain the broad Exception boundary so
control-flow exceptions propagate, add the explicit BLE001 suppression for the
intentional catch, and replace the silent pass with contextual exception
logging.
In `@sdk/runanywhere-python/tests/test_model_streaming.py`:
- Around line 48-49: Update the streaming tests around LLMModel construction to
use a shared fixture that replaces runanywhere._native.get_core with FakeCore,
rather than passing FakeCore directly into each model. Construct every affected
model through this get_core seam so the tests remain native-free while
exercising the required lifecycle boundary.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e809a91d-883c-4186-b457-b0bafc6b63c3
📒 Files selected for processing (25)
.github/workflows/pr-build.ymlidl/codegen/generate_python.shsdk/runanywhere-python/LICENSEsdk/runanywhere-python/native/module.cppsdk/runanywhere-python/native/posix_platform_adapter.cppsdk/runanywhere-python/native/win32_platform_adapter.cppsdk/runanywhere-python/pyproject.tomlsdk/runanywhere-python/runanywhere/_native/_core.pyisdk/runanywhere-python/runanywhere/_proto/__init__.pysdk/runanywhere-python/runanywhere/_proto/rac_options_pb2.pysdk/runanywhere-python/runanywhere/_proto/rag_pb2.pysdk/runanywhere-python/runanywhere/cli/__init__.pysdk/runanywhere-python/runanywhere/cli/handlers.pysdk/runanywhere-python/runanywhere/cli/output.pysdk/runanywhere-python/runanywhere/client.pysdk/runanywhere-python/runanywhere/download.pysdk/runanywhere-python/runanywhere/events.pysdk/runanywhere-python/runanywhere/models.pysdk/runanywhere-python/runanywhere/server/app.pysdk/runanywhere-python/tests/test_cli.pysdk/runanywhere-python/tests/test_client.pysdk/runanywhere-python/tests/test_download.pysdk/runanywhere-python/tests/test_grammar.pysdk/runanywhere-python/tests/test_model_streaming.pysdk/runanywhere-python/tests/test_parity_fixes.py
🚧 Files skipped from review as they are similar to previous changes (20)
- sdk/runanywhere-python/runanywhere/_proto/init.py
- sdk/runanywhere-python/runanywhere/_proto/rag_pb2.py
- sdk/runanywhere-python/runanywhere/_proto/rac_options_pb2.py
- sdk/runanywhere-python/tests/test_download.py
- sdk/runanywhere-python/runanywhere/cli/init.py
- sdk/runanywhere-python/runanywhere/cli/output.py
- sdk/runanywhere-python/pyproject.toml
- sdk/runanywhere-python/native/win32_platform_adapter.cpp
- sdk/runanywhere-python/native/posix_platform_adapter.cpp
- sdk/runanywhere-python/tests/test_parity_fixes.py
- idl/codegen/generate_python.sh
- sdk/runanywhere-python/tests/test_client.py
- sdk/runanywhere-python/tests/test_cli.py
- sdk/runanywhere-python/runanywhere/cli/handlers.py
- sdk/runanywhere-python/runanywhere/models.py
- sdk/runanywhere-python/runanywhere/client.py
- .github/workflows/pr-build.yml
- sdk/runanywhere-python/tests/test_grammar.py
- sdk/runanywhere-python/runanywhere/server/app.py
- sdk/runanywhere-python/native/module.cpp
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Overnight hardening complete (ready for morning review)Addressed all PR review comments in-tree (no new GitHub issues). Capability + architecture review vs Swift/commons completed. Fixes landed (latest commits on
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
macOS runners install grpcio-tools for python3 while bare `python` pointed at a different interpreter without the module, breaking the IDL drift gate. Co-authored-by: Cursor <cursoragent@cursor.com>
BSD sed rejects GNU `a` syntax; rewrite imports and insert the future import with Python so the IDL drift gate works on macos-15 runners. Co-authored-by: Cursor <cursoragent@cursor.com>
python-multipart>=0.0.32 requires 3.10+; pin the last 3.9-compatible line via environment markers so the Linux 3.9 CI hermetic install works. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
runanywhere) over therac_*C ABI via pybind11, with hermetic tests and wheel CI (Linux 3.9+3.12, macOS, Windows).api_key/base_urlclient knobs, full IDLErrorCodetable aligned with commons categories, VAD unload leases + Win32_ftelli64, RAG registry ABI constants, IDL Python codegen wired into drift CI.cancel(wired into streamon_stop), Sileroload_vad_model,embed_batch, registry get/list/remove, VLM generation options.sdk/runanywhere-python/AGENTS.md(symlinkCLAUDE.md).Test plan
pytesthermetic suite (438 passed, 20 skipped) in clean venvpython-linux/python-macospreviously green; re-check after this push (incl. 3.9 matrix)idl-drift-checkinstallsgrpcio-toolsand covers_proto/**