Commit 6763e1e
authored
⚡ Improve uv build caching by removing unconditional
## Description
This PR removes the unconditional `reinstall-package = ["mqt-core"]`
configuration from the `uv` settings.
The purpose of this setting was to ensure that mqt-core is rebuilt, when
the `bindings` directory changed, in order to avoid having a stale
version of mqt-core installed.
However, this had the unintended consequence that the package was
_always_ rebuilt and `uv` could never cache the built wheel.
This is extremely apparent in our CI, where this adds very negatively to
our CI runtimes.
Our Python test suite runs 5 versions of Python (at the moment 3.10,
3.11, 3.12, 3.13, and 3.14) both with minimum dependencies and latest
dependencies. On main, this produces 10 separate builds.
Simply dropping the setting was not an option because of the above use
case.
But it turns out that `uv` is offering more fine granular controls over
the caching mechanism since literally forever and we just haven't found
it.
This PR, instead of the unconditional `reinstall-package`, sets
`tool.uv.cache-keys` which means that the package will be rebuilt
whenever
- `pyproject.toml` changes (uv does this by default), or
- any commit or tag information changes (which matches changes caused by
setuptools-scm), or
- any `.cpp` file in the `bindings` folder changes.
This reduces the number of builds from 10 down to 3 (3.10, 3.11, 3.12+
ABI3), which should drastically decrease our CI times.
## Checklist:
<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->
- [x] The pull request only contains commits that are focused and
relevant to this change.
- [x] I have added appropriate tests that cover the new/changed
functionality.
- [x] I have updated the documentation to reflect these changes.
- [x] I have added entries to the changelog for any noteworthy
additions, changes, fixes, or removals.
- [x] I have added migration instructions to the upgrade guide (if
needed).
- [x] The changes follow the project's style guidelines and introduce no
new warnings.
- [x] The changes are fully tested and pass the CI checks.
- [x] I have reviewed my own code changes.
Signed-off-by: burgholzer <burgholzer@me.com>reinstall-package and configuring dedicated cache-keys (#1412)1 parent b9f6cf8 commit 6763e1e
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
| 292 | + | |
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
307 | 311 | | |
308 | 312 | | |
309 | 313 | | |
| |||
0 commit comments