Goal
Stand up a minimal Rust crate iaf-core inside the repo (or a sibling repo, decision in this spike) that can be imported from Python via PyO3 + maturin, with a green CI build that produces wheels for all supported targets. No business logic yet — just the scaffolding and a hello_from_rust() smoke function callable from Python.
Tasks
Acceptance criteria
pip install -e .[native] works locally on macOS arm64 with a stable Rust toolchain.
pytest tests/native/test_smoke.py passes both with and without the native module installed (skipped when absent).
- Wheels are produced on every push to
dev and uploaded as CI artifacts.
Out of scope
- Any actual metric or bundle logic (covered by follow-up issues).
- Publishing to PyPI (separate release issue once parity is reached).
Part of the Epic: hybrid Python + Rust acceleration.
Goal
Stand up a minimal Rust crate
iaf-coreinside the repo (or a sibling repo, decision in this spike) that can be imported from Python via PyO3 + maturin, with a green CI build that produces wheels for all supported targets. No business logic yet — just the scaffolding and ahello_from_rust()smoke function callable from Python.Tasks
iaf_core/subcrate inside this repo (Cargo + maturin) vs. separateiaf-corerepo published asinvesting-algorithm-framework-coreon PyPI. Document trade-offs.iaf-core(lib) andiaf-core-py(PyO3 cdylib).pyproject.tomlbuild backend =maturin. Optional install of the native module via an extra (e.g.pip install investing-algorithm-framework[native]) so users without a Rust toolchain are unaffected.from investing_algorithm_framework._native import recalculate_metricsfalls back to the pure-Python implementation when the native module is absent. Add a feature-flag env var (e.g.IAF_NATIVE=0) to force pure-Python for debugging.maturin-actionfor macOS (x86_64 + arm64), Linux (x86_64 + arm64 manylinux), Windows; Python 3.10 / 3.11 / 3.12. Linux arm64 via cross ormaturin build --target aarch64-unknown-linux-gnu.cargo fmt,cargo clippy -- -D warnings,cargo testin CI.hello_from_rust()smoke test exercised from a Python unit test, gated on the native module being importable.Acceptance criteria
pip install -e .[native]works locally on macOS arm64 with a stable Rust toolchain.pytest tests/native/test_smoke.pypasses both with and without the native module installed (skipped when absent).devand uploaded as CI artifacts.Out of scope
Part of the Epic: hybrid Python + Rust acceleration.