Repository navigation
Description
Part of #14
Follow-up to #63 and PR #71.
Summary
The recent Rust migration moved the main CLI/runtime flows into fastled-cli and fastled._native, but a noticeable slice of the app layer is still Python-owned or Python-first. We should finish that cut-over so the default user-facing app flow is native Rust, with Python reduced to a thin compatibility/API layer.
This issue is about the remaining app/orchestration path, not the archive/downloader work already tracked in #63.
Current state
Today:
src/fastled/app.pyandsrc/fastled/cli.pyare compatibility shims that forward to the Rust CLI.src/fastled/build_service.py,src/fastled/project_init.py,src/fastled/sketch.py, andsrc/fastled/string_diff.pyhave native fast paths, but still carry Python fallback logic and Python-owned interfaces.- Several app-facing modules are still Python implementations or Python-first orchestration:
src/fastled/args.pysrc/fastled/parse_args.pysrc/fastled/compile_native.pysrc/fastled/build_types.pysrc/fastled/open_browser.pysrc/fastled/select_sketch_directory.pysrc/fastled/frontend_esbuild.py
That leaves the runtime architecture mixed: Rust is authoritative for the CLI, but Python still owns meaningful pieces of app behavior and fallback control flow.
Goal
Make Rust the authoritative implementation for the app flow and reduce Python to:
- the public package/API surface
- minimal PyO3 bindings / compatibility shims
- the truly hard-to-port pieces we intentionally keep in Python
Scope
In scope
- Port or eliminate the remaining Python orchestration modules used by the app flow.
- Move interactive sketch selection / compile target resolution into Rust.
- Move any remaining app-side build/request/result typing to Rust/PyO3-owned types.
- Remove Python fallbacks where the Rust native path is now expected to exist.
- Tighten the Python package so it calls native Rust APIs directly instead of re-implementing app behavior.
Out of scope
- The repo/archive + extension downloader work in Port project_init + chrome extension downloaders to Rust; drop httpx #63.
- Meson/Ninja/Emscripten internals that are still intentionally Python-owned.
- Playwright/browser automation unless it blocks the native app flow.
Suggested tasks
- Audit the current app/runtime call graph and mark each remaining Python module as either
port,keep, ordelete. - Port
select_sketch_directory.pybehavior intofastled-cli/fastled._native. - Port or remove
args.py+parse_args.pyfrom any remaining runtime path. - Port
build_types.pyfully so Python stops owning build request/result structs. - Move
compile_native.pyorchestration into Rust, or reduce it to a trivial wrapper around native bindings. - Port/remove the remaining app-side browser/build-launch orchestration in
open_browser.pyandfrontend_esbuild.pywhere still relevant. - Remove Python fallback branches from
build_service.py,project_init.py,sketch.py, andstring_diff.pyonce native support is mandatory. - Update tests to assert the Rust/native path is primary and Python is compatibility-only.
- Remove dead Python modules left behind by the cut-over.
Acceptance criteria
fastledapp/compile/watch flows are driven by Rust-native code paths by default.- The Python package no longer owns core app orchestration logic.
- Remaining Python modules are either compatibility wrappers or explicitly documented holdouts.
rg "python -m fastled.app|parse_args\(|BuildService\(" src/fastledno longer shows Python as the primary runtime owner for the app flow.- Unit/integration tests pass with the native path as the default.
Notes
A good end state is that src/fastled/app.py / cli.py remain tiny compatibility shims, while the substantive app behavior lives in crates/fastled-cli and crates/fastled-py.
Migration directive
During the Python compatibility-shim phase, keep the Rust CLI binary installed as fastled-rs[.exe] so a Python fastled entry point cannot recursively resolve itself. When the app flow is fully migrated to Rust, promote fastled-rs[.exe] back to fastled[.exe] and make fastled a bundled binary entry point instead of a Python console-script shim so launch is direct and faster.
Activity
Port remaining Python app orchestration to Rust (closes #72) (#77)
zackees commentedon May 13, 2026
Don't close this python layer is just a thin api shim to rust code.
fix: isolate rust cli migration binary (#83)
feat: move wasm build orchestration into rust (#84)
refactor: finish rust python boundary cleanup (#87)