Skip to content

Phase 1b: Add maturin build backend and PyO3 bridge stub #16

Closed

Description

@zackees

Part of #14
Depends on Phase 1a (#15)

Goal

Wire up maturin so pip install -e . builds the Rust cdylib and exposes fastled._native to Python.

Tasks

  • Update pyproject.toml build-system to use maturin (requires = ["maturin>=1.7,<2"], build-backend = "maturin")
  • Add [tool.maturin] section pointing to crates/fastled-py/Cargo.toml, module-name = "fastled._native", python-source = "src", features pyo3/extension-module, pyo3/abi3-py310
  • Implement crates/fastled-py/src/lib.rs with #[pymodule] exposing version() -> String
  • Add from fastled._native import version as _native_version to src/fastled/__init__.py (guarded with try/except for pure-Python fallback)
  • Verify pip install -e . builds the native extension
  • Verify python -c "from fastled._native import version; print(version())" works
  • Verify existing bash test still passes

Acceptance criteria

  • pip install -e . compiles Rust and installs the native module
  • Python can import fastled._native.version()
  • All existing Python tests pass unchanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions