Skip to content

chore: remove dead code and Docker remnants leftover from refactors #59

Closed

Description

@zackees

Summary

Sweeping audit found ~10 items of orphaned source files, build scripts, and
empty directories that survived the Rust-migration and Docker-purge (#55)
refactors. None are referenced by any live code path or workflow. Removing
them reduces noise and prevents future confusion.

Verified by grepping for inbound references across *.py, *.rs, *.toml,
*.yml, *.sh, *.md, and Cargo.toml. Excluded .venv/ and
.claude/worktrees/ from the grep.

HIGH confidence — orphan Python modules

  • src/fastled/cli_test_interactive.py — zero inbound imports. Manual
    interactive test script added in commit 41b6206. Hardcoded paths
    (../fastled, examples/FxWave2d) suggest a dev-only convenience that
    was never wired into the test suite.
  • src/fastled/paths.py — defines HERE and PROJECT_ROOT constants
    that nothing imports.

HIGH confidence — Docker remnants missed by #55

The "purge Docker references" PR (#55, Apr 12) missed these:

  • entrypoint.sh — Docker container entrypoint. Sources
    /emsdk/emsdk_env.sh (container path) and calls
    fastled_wasm_compiler.cli_update_from_master (a module from a separate
    package that only exists inside the container).
  • compiler/run.py — Docker compile-server entry point. Imports
    fastled_wasm_compiler (separate package, not in this repo).
  • compiler/debug.sh — instructs the user to run it from /js
    (container working directory).
  • .dockerignore — only contains cache exclusions
    (**/.mypy_cache/, **/.ruff_cache/) which belong in .gitignore.

MEDIUM-HIGH confidence

  • chrome_vscode_bridge_design_task.md — one-off design draft
    beginning "Here's a refined chrome_vscode_bridge_design_task.md file for
    your repo. Feel free to adjust paths, placeholders, or formatting…"
    .
    Zero references anywhere else in the repo.
  • upload_package.sh — manual PyPI upload helper. Superseded by
    publish_release.yml's automated PyPI publish step. Zero inbound
    references.

LOW priority — empty directories

  • fastled/ (root-level, empty dir, last modified 2025-03-21)
  • templates/ (root-level, empty dir, last modified 2024-12-14)

Both are untracked-empty leftovers from previous layouts.

Out of scope (verified live)

For the record, these look dead but aren't:

  • _cargo, _rustc, _rustfmt — Rust toolchain trampolines (used during
    local dev to prefer rustup-managed binaries over Chocolatey).
  • build_site.py — used by build_webpage.yml:27.
  • build_exe.py — used by publish_release.yml.
  • *.spec files at root — locally-generated PyInstaller artifacts,
    not tracked in git.
  • demo/, site/, fastled/ (the populated one at src/fastled/),
    crates/, examples/, tests/ — all live.

Suggested removal in a single PR

Single sweep:

git rm src/fastled/cli_test_interactive.py
git rm src/fastled/paths.py
git rm entrypoint.sh
git rm compiler/run.py compiler/debug.sh
git rm .dockerignore
git rm chrome_vscode_bridge_design_task.md
git rm upload_package.sh
rmdir fastled templates

Run bash test and bash lint after — neither should regress, since none
of these are imported.

Activity

  1. zackees commented on May 12, 2026

    @zackees
    MemberAuthor

    Follow-up: additional Python elimination after Rust migration

    Second-pass audit of src/fastled/*.py looking for files now superseded by the Rust crates (crates/fastled-cli, crates/fastled-py, crates/fastled-tauri). PR #61 already handled the orphan modules from the original sweep (cli_test.py, cli_test_interactive.py, install/test_install.py, plus Tools / CompileOrLink / _handle_ino_cpp). Still pending from this issue: src/fastled/paths.py and the non-Python items (shell scripts, .dockerignore, draft markdown, empty fastled/ dir).

    NEW HIGH-CONFIDENCE removal

    src/fastled/filewatcher.py — full file (~300 lines)

    • Only inbound reference is tests/unit/test_filechanger.py, which exists only to test this module.
    • Production callers: zero. Comments in compile_native.py:95-99 explicitly state: ""The HTTP server and file watching are now handled by the Rust CLI.""
    • Rust equivalent: file watching is owned by the Rust CLI binary (see crates/fastled-cli/).
    • Cascading removals:
      • tests/unit/test_filechanger.py — only consumer of FileWatcherProcess.
      • watchdog>=6.0.0 from pyproject.toml — filewatcher.py is the only importer of watchdog in the entire codebase.

    Investigated but kept (not removable yet)

    File Why kept
    src/fastled/open_browser.py Backs Test.spawn_http_server in __init__.py (public Python API surface). It already shells out to the Rust CLI / Tauri viewer, so it's already a thin wrapper — but the public-API contract keeps it alive.
    src/fastled/frontend_esbuild.py Live callers in toolchain/internal_wasm_build.py:1514 and toolchain/emscripten.py:792 (copy_frontend_to_output). Would need a Rust replacement for those callers before this can go.

    The remaining Python surface (app.py, args.py, parse_args.py, compile_native.py, build_service.py, project_init.py, select_sketch_directory.py, keyboard.py, interrupts.py, util.py, emoji_util.py, spinner.py, string_diff.py, settings.py, sketch.py, debug_symbols.py, print_filter.py) is all live — entry-point chain, build orchestration, or CLI/UX helpers. Python is already minimal post-migration.

    Proposed PR scope (Python-only)

    git rm src/fastled/paths.py            # already in this issue
    git rm src/fastled/filewatcher.py      # NEW
    git rm tests/unit/test_filechanger.py  # NEW (cascading)
    

    Plus removing "watchdog>=6.0.0" from pyproject.toml.

    Non-Python items from this issue (entrypoint.sh, compiler/run.py, compiler/debug.sh, .dockerignore, chrome_vscode_bridge_design_task.md, upload_package.sh, empty fastled/ dir) are out of scope for the Python sweep — they belong in a separate cleanup pass.

  2. zackees commented on May 13, 2026

    @zackees
    MemberAuthor

    Update: PR #62 — Rust now owns emscripten + esbuild installs

    PR #62 has been extended to actually move the toolchain downloads into Rust (not just delete dead deps). Live there now: #62

    Commits in the PR:

    1. Python footprint shrink (dead modules + stdlib swaps).
    2. wait_for_server HTTP probe dropped (redundant with the Rust URL printout).
    3. ensure_emscripten_installed() in crates/fastled-cli/src/install.rs — manifest fetch + multipart SHA-256-verified download + .tar.zst extract + .emscripten config. Wired into compile_and_serve() ahead of the Python invocation; sets FASTLED_EMSCRIPTEN_DIR. Uses the ctcb-manifest crate from clang-tool-chain-bins for the manifest schema. Drops clang-tool-chain and pyzstd.
    4. ensure_esbuild_installed() — same shape for the esbuild npm tarball; new extract_member_from_tgz archive helper. Drops fasteners (last consumer removed).

    Python runtime deps: 8 → 2

    • Dropped: watchdog, watchfiles, disklru, zccache, progress, rapidfuzz, clang-tool-chain, fasteners
    • Remaining: httpx, zcmds_win32 (Windows-only)

    Still pending (deferred to follow-up PRs)

    What keeps httpx alive:

    • src/fastled/project_init.py — --init flow downloads the FastLED repo zip. Needs a Rust ensure_fastled_repo(ref) port that handles ref resolution (latest-release via GitHub API, branch, tag, commit SHA) + extract + return local path. Then --init is handled fully in Rust and Python's Api.project_init shells to it.
    • src/fastled/playwright/chrome_extension_downloader.py — runtime Chrome Web Store fetch for the C++ DevTools extension in the Tauri viewer. Needs a Rust ensure_chrome_extension() port + Tauri viewer integration.

    These are tractable but each is a real Rust feature that deserves its own review surface. PR #62 stops at the toolchain installs because those have the cleanest test surface (cold-cache install test, no UX side-effects).

    Note: open_browser.py Rust port

    Discussed during PR work: the Python open_browser.py is now a thin shim (_find_fastled_cli, subprocess launch, URL parse, optional viewer/browser launch). The Rust CLI's compile_and_serve already covers most of this natively. The Python public API surface (Test.spawn_http_server consumed by tests/integration/test_animartrix_e2e.py) keeps the Python shim alive. Full removal would mean either deleting Test.spawn_http_server or rewriting the integration test against the Rust binary directly — orthogonal to httpx removal, file separately if pursued.

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