Commit 545c0c8
feat: Python bindings (PyO3) (#70)
* docs: add requirements document for python bindings
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
* docs: minor update
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
* docs: add issue 19 implementation plan
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
* docs: add ce implementation plan for issue 19
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
* feat(bindings/python): add PyO3 native bindings for cpex-core PluginManager
Introduces `bindings/python/` — a new maturin-built Rust crate (`cpex-python`)
that wraps `cpex_core::PluginManager` via PyO3 0.29, exposing a native Python
`cpex` package backed entirely by the Rust runtime.
Key design points:
- `PluginManager(config_path)` — sync constructor; registers APL factories then
loads YAML config (order critical for APL Weak upgrade)
- `initialize()`, `shutdown()`, `invoke_hook()` — async via pyo3-async-runtimes
`future_into_py`; all guarded by a 60 s wall-clock timeout (PY_WALL_CLOCK_TIMEOUT)
- CMF hooks route payloads through `MessagePayload`; all others use a local
`GenericPayload<serde_json::Value>`
- `PipelineResult` exposes 7 read-only Python getters; `__repr__` is pointer-free
- `cpex-python` is in `[workspace] members` but not `default-members`, so all
pure-Rust CI targets remain libpython-independent (`--exclude cpex-python`)
- Makefile gains `bindings-python-{build,build-release,test}` targets
- 22 unit/integration tests; all pass alongside 2058 legacy tests (AE3)
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: Fixed the Python bindings build after the dev branch merge: updated Cargo.toml and builtins.rs to use the new cpex-builtins facade, then resolved two clippy lint failures.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: remove unused dependencies
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: build and test bindings/python in ci
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: Added panic isolation and timeout coverage to the Python bindings.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: run cargo update with env set: CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: drop swatinem/rust-cache. rust-cache restores a partial `~/.cargo/registry` index ("full match: false"); with the sparse protocol, , `cargo package --locked` consults that stale local index, finds it can't satisfy the committed lock, and aborts with "cannot update the lock file" (fails ~1.4s in — too fast for a real network fetch) even though Cargo.lock resolves cleanly against a fresh index. Fetching the index fresh each run keeps this dry-run deterministic.
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: Removing the index forces a clean fetch, against which Cargo.lock resolves cleanly — keeping this dry-run deterministic.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: cargo lock update
Signed-off-by: habeck <habeck@us.ibm.com>
---------
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
Signed-off-by: habeck <habeck@us.ibm.com>
Co-authored-by: Frederico Araujo <frederico.araujo@ibm.com>
Co-authored-by: Teryl Taylor <terylt@ibm.com>1 parent e21dc1b commit 545c0c8
28 files changed
Lines changed: 3328 additions & 318 deletions
File tree
- .github/workflows
- bindings/python
- python/cpex
- src
- tests
- fixtures
- docs
- dev
- plans
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
120 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
121 | 134 | | |
122 | 135 | | |
123 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
0 commit comments