Closed cdce8p closed 1 week ago
@cdce8p please motivate why the home assistant version should be part of the cache key, it's not clear from the PR description
Some background. To speed up the venv creation, we also cache the wheels. That cache is reset after each HA version bump (through the cache key) to keep it from growing indefinitely. No need to cache no longer used wheels.
What happens after the version bump PR is merged? At the moment, the venv cache is still up-to-date and will be used for any runs. However, the wheels cache is reset. That means that the first PR which updates a requirement will run from a cold wheels cache, i.e. 3-4min for the venv creation instead of the usual 20-30s. As the wheels cache created for a PR branch cannot be used by other PRs, that happens for every PR until the first one is merged into dev. After that, since the venv needs to be created from scratch, the wheels cache is also created and all subsequent venv creations will be fast again.
Adding the HA version to the venv cache key just means we create the new wheels cache directly after the version bump. Thus removing the initial friction.
Hope that explains it.
Proposed change
Force creation of new venv after a HA version bump. Although the venv could technically be reused, we want to create a new one to populate the wheels cache and speedup subsequent PRs.
The wheels cache is only created if a new venv is needed.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: