Skip to content

Warn when using uv_build settings without uv_build#15750

Merged
zanieb merged 1 commit intomainfrom
konsti/warn-on-unused-build-backend-settings
Mar 5, 2026
Merged

Warn when using uv_build settings without uv_build#15750
zanieb merged 1 commit intomainfrom
konsti/warn-on-unused-build-backend-settings

Conversation

@konstin
Copy link
Member

@konstin konstin commented Sep 9, 2025

To help with cases such as #15655.

A question is when to show this warning. I've used sources as a proxy as URL dependencies with enabled sources are likely those controlled by the user, and they include workspace and git cloned path dependencies.

The first commit is a refactoring, the second commit the implementation.

Fixes #15740

@konstin konstin added error messages Messaging when something goes wrong build-backend labels Sep 9, 2025
@konstin konstin temporarily deployed to uv-test-registries September 9, 2025 12:26 — with GitHub Actions Inactive
Comment on lines +604 to +605
"There are settings for the `uv_build` build backend defined in \
`tool.uv.build-backend`, but the project does not use the `uv_build` backend: {}",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One potential drawback is that we assume that all future versions will have build-system = "uv_build".

@konstin konstin force-pushed the konsti/warn-on-unused-build-backend-settings branch from fad531f to 0226753 Compare September 16, 2025 10:19
@konstin konstin temporarily deployed to uv-test-registries September 16, 2025 10:21 — with GitHub Actions Inactive
Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been wanting to make this refactor for a while now

nice

Comment on lines +1059 to +1061
warning: There are settings for the `uv_build` build backend defined in `tool.uv.build-backend`, but the project does not use the `uv_build` backend: [TEMP_DIR]/pyproject.toml
Building wheel from source distribution...
warning: There are settings for the `uv_build` build backend defined in `tool.uv.build-backend`, but the project does not use the `uv_build` backend: [CACHE_DIR]/sdists-v9/[TMP]/pyproject.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid warning multiple times here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to figure our something that works despite the different paths

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the path, it's clearer this was got Git dependencies too.


----- stderr -----
Building source distribution...
warning: There are settings for the `uv_build` build backend defined in `tool.uv.build-backend`, but the project does not use the `uv_build` backend: [TEMP_DIR]/pyproject.toml
Copy link
Member

@zanieb zanieb Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to rephrase so it's clearer what we're referring to at the end, e.g., "but the uv_build backend is not used by the project at: PATH"

@konstin konstin temporarily deployed to uv-test-registries September 16, 2025 16:17 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-registries September 17, 2025 10:52 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/warn-on-unused-build-backend-settings branch from 44c9302 to a7d14f7 Compare October 9, 2025 13:39
@konstin konstin temporarily deployed to uv-test-registries October 9, 2025 13:42 — with GitHub Actions Inactive
@HACK55515

This comment was marked as off-topic.

Comment on lines +607 to +608
// Show name/version where available to avoid showing a (duplicate) warning with
// a temporary path.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'm not sure I'd understand this comment without the context from this pull request review)


----- stderr -----
Building source distribution...
warning: `pyproject.toml` of project==0.1.0 defines settings for `uv_build` in `tool.uv.build-backend`, but does not use `uv_build`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to say "pyproject.toml of"? Isn't that the only place it can be defined?

Does it make sense to say the version? If it's first-party, isn't the version just noise? (and it's present in the built file name too if really helpful).

I think I'd be confused about what it means that it doesn't use uv_build, maybe it'd help to show the other backend?

I think I might say

project-name defines settings for uv_build in tool.uv.build-backend, but does not use uv_build ()

where <hint> is like

(no build-system is defined)

or

(build-system uses hatchling)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the hint to show only the package name and also show the actual build backend

@konstin konstin force-pushed the konsti/warn-on-unused-build-backend-settings branch from 9c5cf83 to 1975616 Compare December 11, 2025 14:42
@konstin konstin temporarily deployed to uv-test-registries December 11, 2025 14:46 — with GitHub Actions Inactive
@konstin konstin force-pushed the konsti/warn-on-unused-build-backend-settings branch from 1975616 to 0912eea Compare February 20, 2026 14:26
Err(err) => Err(Box::new(err.into())),
}

let backend = if let Some(build_system) = pyproject_toml.build_system {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code only moved.

@konstin konstin force-pushed the konsti/warn-on-unused-build-backend-settings branch from 0912eea to bb4e82e Compare February 20, 2026 14:40
@zanieb zanieb merged commit 87b2539 into main Mar 5, 2026
53 checks passed
@zanieb zanieb deleted the konsti/warn-on-unused-build-backend-settings branch March 5, 2026 12:56
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 11, 2026
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 ([#&#8203;18338](astral-sh/uv#18338))
- Add torchcodec to PyTorch List ([#&#8203;18336](astral-sh/uv#18336))
- Log the duration we took before erroring ([#&#8203;18231](astral-sh/uv#18231))
- Warn when using `uv_build` settings without `uv_build` ([#&#8203;15750](astral-sh/uv#15750))
- Add fallback to `/usr/lib/os-release` on Linux system lookup failure ([#&#8203;18349](astral-sh/uv#18349))
- Use `cargo auditable` to include SBOM in uv builds ([#&#8203;18276](astral-sh/uv#18276))

##### Configuration

- Add an environment variable for `UV_VENV_RELOCATABLE` ([#&#8203;18331](astral-sh/uv#18331))

##### Performance

- Avoid toml `Document` overhead ([#&#8203;18306](astral-sh/uv#18306))
- Use a single global workspace cache ([#&#8203;18307](astral-sh/uv#18307))

##### Bug fixes

- Continue on trampoline job assignment failures ([#&#8203;18291](astral-sh/uv#18291))
- Handle the hard link limit gracefully instead of failing ([#&#8203;17699](astral-sh/uv#17699))
- Respect build constraints for workspace members ([#&#8203;18350](astral-sh/uv#18350))
- Revalidate editables and other dependencies in scripts ([#&#8203;18328](astral-sh/uv#18328))
- Support Python 3.13+ on Android ([#&#8203;18301](astral-sh/uv#18301))
- Support `cp3-none-any` ([#&#8203;17064](astral-sh/uv#17064))
- Skip tool environments with broken links to Python on Windows ([#&#8203;17176](astral-sh/uv#17176))

##### Documentation

- Add documentation for common marker values ([#&#8203;18327](astral-sh/uv#18327))
- Improve documentation on virtual dependencies ([#&#8203;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 ([#&#8203;18247](astral-sh/uv#18247))
- Add resolver hint when `--exclude-newer` filters out all versions of a package ([#&#8203;18217](astral-sh/uv#18217))
- Configure a real retry minimum delay of 1s ([#&#8203;18201](astral-sh/uv#18201))
- Expand `uv_build` direct build compatibility ([#&#8203;17902](astral-sh/uv#17902))
- Fetch CPython from an Astral mirror by default ([#&#8203;18207](astral-sh/uv#18207))
- Download uv releases from an Astral mirror in installers by default ([#&#8203;18191](astral-sh/uv#18191))
- Add SBOM attestations to Docker images ([#&#8203;18252](astral-sh/uv#18252))
- Improve hint for installing meson-python when missing as build backend ([#&#8203;15826](astral-sh/uv#15826))

##### Configuration

- Add `UV_INIT_BARE` environment variable for `uv init` ([#&#8203;18210](astral-sh/uv#18210))

##### Bug fixes

- Prevent `uv tool upgrade` from installing excluded dependencies ([#&#8203;18022](astral-sh/uv#18022))
- Promote authentication policy when saving tool receipts ([#&#8203;18246](astral-sh/uv#18246))
- Respect exclusions in scripts ([#&#8203;18269](astral-sh/uv#18269))
- Retain default-branch Git SHAs in `pylock.toml` files ([#&#8203;18227](astral-sh/uv#18227))
- Skip installed Python check for URL dependencies ([#&#8203;18211](astral-sh/uv#18211))
- Respect constraints during `--upgrade` ([#&#8203;18226](astral-sh/uv#18226))
- Fix `uv tree` orphaned roots and premature deduplication ([#&#8203;17212](astral-sh/uv#17212))

##### Documentation

- Mention cooldown and tweak inline script metadata in dependency bots documentation ([#&#8203;18230](astral-sh/uv#18230))
- Move cache prune in GitLab to `after_script` ([#&#8203;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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-backend error messages Messaging when something goes wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn when tool.uv.build-backend is set but wrong [build-system] is configured

4 participants