Commit 7ffddd3
authored
fix(ci): install hatchling from wheelhouse so offline build backend resolves (#1492)
## Problem
All CI jobs (Code Quality, unit 3.10–3.13, Build) started failing at env
setup with:
```
Failed to resolve requirements from `build-system.requires`
No solution found when resolving: `hatchling`
Because hatchling was not found in the cache and you require hatchling, ...
hint: Packages were unavailable because the network was disabled.
```
## Root cause
PR jobs restore the warm dependency cache and run with
`UV_OFFLINE=true`. Installing the project (editable) invokes the build
backend **`hatchling`**, which is **unpinned in
`[build-system].requires` and absent from `uv.lock`**, so uv must
*resolve* it against JFrog's simple index. JFrog's index responses carry
a short freshness lifetime; once the cached metadata goes stale (a few
hours), offline uv cannot revalidate it and errors `hatchling was not
found in the cache` — breaking every job.
Locked dependencies (from `uv.lock`, pinned + hashed) install from the
content-addressed wheel cache without touching the index, so they were
unaffected — which is why only the unpinned build backend failed.
### Evidence: failure correlates with cache age, not PR content
| Run (UTC) | Trigger | Cache age | Result |
|---|---|---|---|
| Jun-01 07:29 | PR | fresh | ✅ |
| Jun-01 13:20 | PR | ~5.5h | ✅ |
| Jun-01 21:08 | PR | ~13h | ✅ |
| Jun-02 04:57 | **push to main** | ~21h | ❌ |
| Jun-02 05:05 | PR | ~21h | ❌ |
The `main`-branch push failing identically rules out anything
PR-specific.
## Fix
Mirror how the pip-based `verify` envs already install offline
(`PIP_FIND_LINKS`), but for uv's build-isolation resolution:
1. **`warmDepsCache.yml`** — add `hatchling` to the wheelhouse `pip
download` (pulls hatchling + its universal-wheel deps).
2. **`setup-python-deps`** — export
`UV_FIND_LINKS=$HOME/.cache/pip-wheelhouse` in the offline block, so uv
installs the backend from local content-addressed wheels instead of
resolving it against the (stale) index.
## Validation
Reproduced locally: with `UV_OFFLINE=true` and an unusable index, `hatch
build` fails with the exact CI error; adding
`UV_FIND_LINKS=<wheelhouse-with-hatchling>` makes the build succeed
offline.1 parent 19d86a4 commit 7ffddd3
2 files changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
0 commit comments