Extend uv_build direct build compatibility#17902
Conversation
3e6fee9 to
257ba40
Compare
uv 0.10 can use direct builds for uv_build with `<0.10`, there were no breaking changes. This PR also revamps the direct build detection to be more sensitive and improves the errors messages.
257ba40 to
f4873cc
Compare
| .join("`, `") | ||
| )); | ||
| }; | ||
| if uv_requirement.name.as_str() != "uv-build" { |
There was a problem hiding this comment.
Confirming that this is indeed the place where it's uv-build and not uv_build?
There was a problem hiding this comment.
Yep, this is PackageName default normalization which uses dashes.
There was a problem hiding this comment.
Would it make sense to compare to a parsed PackageName instead to make that enforced?
| // If the user doesn't set an upper bound, we don't help them by not using the fast | ||
| // path, their build may equally fail if the index version of `uv_build`, so we allow | ||
| // missing upper bounds. | ||
| if !compatible.iter().any(|version| specifier.contains(version)) { |
There was a problem hiding this comment.
I forget, we version uv_build and uv in lockstep right? Should we also check "the current version of uv" (to avoid having to constantly update the array?)
|
|
||
| /// No breaking changes were introduced to the uv build backend since those releases, so we can use | ||
| /// the fast path for them too. | ||
| const COMPATIBLE_VERSIONS: &[&str] = &["0.9.30"]; |
There was a problem hiding this comment.
Can you elaborate on a situation where you imagine multiple entries in here? Having trouble wrapping my head around it. (You'd need some kind of blocklist to encode a "hole" between versions...)
There was a problem hiding this comment.
If we release 0.11 and there's no breaking changes again, I'll add 0.10.LAST_PATCH to this list.
There was a problem hiding this comment.
I think it's fair to say that we don't need to do that since we have 0.9 and that's continuous to the future release?
There was a problem hiding this comment.
i.e., as Aria says, we shouldn't need holes?
There was a problem hiding this comment.
If you do uv init --lib with the current uv version, you get this:
[build-system]
requires = ["uv_build>=0.10.4,<0.11.0"]
build-backend = "uv_build"If we release uv 0.11 without breaking changes and without another entries in that list, we'd check against 0.9.30 (doesn't match) and 0.11.0 (doesn't match) and couldn't use the fast path. I'm not trying to encode any holes here, it's just a list of still compatible minor versions in a way that works with simple contains checks.
There was a problem hiding this comment.
I can follow-up here if we want to change the strategy.
Co-authored-by: Aria Desires <aria.desires@gmail.com>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [uv](https://github.com/astral-sh/uv) | patch | `0.10.7` → `0.10.9` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (uv)</summary> ### [`v0.10.9`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0109) [Compare Source](astral-sh/uv@0.10.8...0.10.9) Released on 2026-03-06. ##### Enhancements - Add `fbgemm-gpu`, `fbgemm-gpu-genai`, `torchrec`, and `torchtune` to the PyTorch list ([#​18338](astral-sh/uv#18338)) - Add torchcodec to PyTorch List ([#​18336](astral-sh/uv#18336)) - Log the duration we took before erroring ([#​18231](astral-sh/uv#18231)) - Warn when using `uv_build` settings without `uv_build` ([#​15750](astral-sh/uv#15750)) - Add fallback to `/usr/lib/os-release` on Linux system lookup failure ([#​18349](astral-sh/uv#18349)) - Use `cargo auditable` to include SBOM in uv builds ([#​18276](astral-sh/uv#18276)) ##### Configuration - Add an environment variable for `UV_VENV_RELOCATABLE` ([#​18331](astral-sh/uv#18331)) ##### Performance - Avoid toml `Document` overhead ([#​18306](astral-sh/uv#18306)) - Use a single global workspace cache ([#​18307](astral-sh/uv#18307)) ##### Bug fixes - Continue on trampoline job assignment failures ([#​18291](astral-sh/uv#18291)) - Handle the hard link limit gracefully instead of failing ([#​17699](astral-sh/uv#17699)) - Respect build constraints for workspace members ([#​18350](astral-sh/uv#18350)) - Revalidate editables and other dependencies in scripts ([#​18328](astral-sh/uv#18328)) - Support Python 3.13+ on Android ([#​18301](astral-sh/uv#18301)) - Support `cp3-none-any` ([#​17064](astral-sh/uv#17064)) - Skip tool environments with broken links to Python on Windows ([#​17176](astral-sh/uv#17176)) ##### Documentation - Add documentation for common marker values ([#​18327](astral-sh/uv#18327)) - Improve documentation on virtual dependencies ([#​18346](astral-sh/uv#18346)) ### [`v0.10.8`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0108) [Compare Source](astral-sh/uv@0.10.7...0.10.8) Released on 2026-03-03. ##### Python - Add CPython 3.10.20 - Add CPython 3.11.15 - Add CPython 3.12.13 ##### Enhancements - Add Docker images based on Docker Hardened Images ([#​18247](astral-sh/uv#18247)) - Add resolver hint when `--exclude-newer` filters out all versions of a package ([#​18217](astral-sh/uv#18217)) - Configure a real retry minimum delay of 1s ([#​18201](astral-sh/uv#18201)) - Expand `uv_build` direct build compatibility ([#​17902](astral-sh/uv#17902)) - Fetch CPython from an Astral mirror by default ([#​18207](astral-sh/uv#18207)) - Download uv releases from an Astral mirror in installers by default ([#​18191](astral-sh/uv#18191)) - Add SBOM attestations to Docker images ([#​18252](astral-sh/uv#18252)) - Improve hint for installing meson-python when missing as build backend ([#​15826](astral-sh/uv#15826)) ##### Configuration - Add `UV_INIT_BARE` environment variable for `uv init` ([#​18210](astral-sh/uv#18210)) ##### Bug fixes - Prevent `uv tool upgrade` from installing excluded dependencies ([#​18022](astral-sh/uv#18022)) - Promote authentication policy when saving tool receipts ([#​18246](astral-sh/uv#18246)) - Respect exclusions in scripts ([#​18269](astral-sh/uv#18269)) - Retain default-branch Git SHAs in `pylock.toml` files ([#​18227](astral-sh/uv#18227)) - Skip installed Python check for URL dependencies ([#​18211](astral-sh/uv#18211)) - Respect constraints during `--upgrade` ([#​18226](astral-sh/uv#18226)) - Fix `uv tree` orphaned roots and premature deduplication ([#​17212](astral-sh/uv#17212)) ##### Documentation - Mention cooldown and tweak inline script metadata in dependency bots documentation ([#​18230](astral-sh/uv#18230)) - Move cache prune in GitLab to `after_script` ([#​18206](astral-sh/uv#18206)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My40OS4wIiwidXBkYXRlZEluVmVyIjoiNDMuNTcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
uv 0.10 can use direct builds for uv_build with
<0.10, there were no breaking changes.This PR also revamps the direct build detection to be more sensitive and improves the errors messages.