Skip to content

Include setup.py in CI venv and Rust extension cache keys - #134

Merged
puddly merged 1 commit into
puddly:devfrom
TheJulianJES:tjj/ci-cache-setup-py
Oct 12, 2026
Merged

puddly merged 1 commit into
puddly:devfrom
TheJulianJES:tjj/ci-cache-setup-py

Conversation

@TheJulianJES

Copy link
Copy Markdown
Contributor

Since #128, the Rust extension is defined in setup.py instead of pyproject.toml. This adds setup.py to the CI cache keys, so changing it invalidates the cached venvs and Rust extension builds.

Changes

  • Add setup.py to all base venv cache keys (all jobs restoring the venv use the same key).
  • Add setup.py to the macOS/Windows Rust extension cache keys.

Detailed AI-generated PR description

Verbose AI-generated PR description (CLICK TO EXPAND)

The base venv cache key hashes pyproject.toml, Cargo.toml, Cargo.lock and src/**, and the macOS/Windows Rust extension cache key hashes the Cargo files and src/**. Before #128, the extension was configured through [tool.setuptools-rust] in pyproject.toml, so a change to it invalidated the cached venvs. #128 moved the RustExtension(...) definition (and the platform check deciding whether to build it) into setup.py, which isn't part of either key. A future change there, e.g. to the extension's arguments or the platform check, would then be served stale cached venvs and extension builds on macOS/Windows.

This adds setup.py to:

  • the base venv key in all 8 places that build or restore it (prepare-base, prek, pytest, pytest-esphome, pytest-macos, pytest-windows, pytest-serialx-compat, coverage). They have to stay identical, since most jobs restore with fail-on-cache-miss: true.
  • the Rust extension key of the macOS and Windows test jobs.

No other cache keys depend on setup.py (prek, ESPHome daemon, CP2102 emulator, cp210x modules, ser2net, Pyodide).

As the keys change, this PR's CI rebuilds all venvs once.

Related:

The Rust extension is now defined in `setup.py` instead of `pyproject.toml`,
so changes to it need to invalidate the cached venv and extension builds.
@TheJulianJES
TheJulianJES marked this pull request as ready for review October 12, 2026 17:28
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.31%. Comparing base (7334430) to head (147d3b6).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #134   +/-   ##
=======================================
  Coverage   94.31%   94.31%           
=======================================
  Files          25       25           
  Lines        4345     4345           
=======================================
  Hits         4098     4098           
  Misses        247      247           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@puddly
puddly merged commit 0615c78 into puddly:dev Oct 12, 2026
31 checks passed
@TheJulianJES
TheJulianJES deleted the tjj/ci-cache-setup-py branch October 12, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants