Skip to content

Respect [tool.uv.sources] for extra build dependencies in uv build and uv run --with#18085

Draft
zanieb wants to merge 1 commit intoastral-sh:mainfrom
zaniebot:claude/fix-index-priority-build-deps-Q4soQ
Draft

Respect [tool.uv.sources] for extra build dependencies in uv build and uv run --with#18085
zanieb wants to merge 1 commit intoastral-sh:mainfrom
zaniebot:claude/fix-index-priority-build-deps-Q4soQ

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Feb 18, 2026

Discovered via #18059 but does not close it as the problem there is that they're not respected consistently in uv pip

When `[tool.uv.sources]` pins a package to an explicit index, that index
pinning was not being applied to extra build dependencies. This was because
the lowering used `from_non_lowered()` which ignores sources/index metadata.

Fix by adding an optional `workspace` parameter to `resolve_environment`,
`sync_environment`, and `resolve_names`. When a workspace is provided, these
functions use `from_workspace()` to lower extra build dependencies with full
source resolution, including index pinning from `[tool.uv.sources]`.

For `uv build`, the lowering is done in `build_impl()` using a settings
workspace discovered from the project directory.

Closes astral-sh#18059

https://claude.ai/code/session_01MEK9fN6ryBcGgqWdnqcgoc
@zanieb zanieb added the bug Something isn't working label Feb 18, 2026
@zanieb zanieb changed the title Respect [tool.uv.sources] for extra build dependencies Respect [tool.uv.sources] for extra build dependencies in uv build and uv run --with Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants