Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ jobs:
# collide on the same cache key and one job fails to save.
cache-key-suffix: lint-${{ inputs.runs-on }}-${{ github.workflow }}

- name: Install rustfmt + clippy components
# setup-soldr reads `channel` from rust-toolchain.toml but does not
# honor the `components` array, so cargo fmt / cargo clippy fail with
# "component is not installed". Provision them explicitly here.
run: rustup component add rustfmt clippy

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
Expand Down
18 changes: 8 additions & 10 deletions ci/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,18 @@ def activate() -> None:


def _apply_rustc_wrapper(env: dict[str, str]) -> dict[str, str]:
"""Set RUSTC_WRAPPER to zccache when available, falling back to sccache.
"""Set RUSTC_WRAPPER to zccache when available.

The project uses zccache (via soldr) for compile caching. Prefer it; fall
back to sccache for environments where only that is installed. Bare cargo
invocations that consume this env still benefit from the cache even though
most callers in this repo now route through ``soldr cargo`` directly.
The project uses zccache (via soldr) for compile caching. Bare cargo
invocations that consume this env still benefit from the cache even
though most callers in this repo route through ``soldr cargo`` directly
(which manages the wrapper itself).
"""
if env.get("RUSTC_WRAPPER"):
return env
for tool in ("zccache", "sccache"):
found = shutil.which(tool, path=env.get("PATH"))
if found:
env["RUSTC_WRAPPER"] = found
return env
found = shutil.which("zccache", path=env.get("PATH"))
if found:
env["RUSTC_WRAPPER"] = found
return env


Expand Down
13 changes: 9 additions & 4 deletions tests/unit/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ class MainTester(unittest.TestCase):
"""Main tester class."""

def test_command(self) -> None:
"""Test command line interface (CLI)."""
"""Test command line interface (CLI).

The Rust CLI emits clap's standard "<bin> <version>" format
(e.g. "fastled 2.0.7"); assert the package __version__ is present
in that output rather than requiring an exact match.
"""
stdout = subprocess.check_output(COMMAND, stdin=subprocess.DEVNULL)
version_stdout = stdout.decode("utf-8").strip()
self.assertEqual(
version_stdout,
self.assertIn(
__version__,
f"FastLED Version mismatch: {version_stdout} (tool output) != {__version__} (package version)",
version_stdout,
f"FastLED Version mismatch: {version_stdout} (tool output) does not contain {__version__} (package version)",
)


Expand Down
Loading