Fix uv index: move indexes to uv.toml, keep sources in pyproject.toml#23454
Fix uv index: move indexes to uv.toml, keep sources in pyproject.toml#23454lowvoltage wants to merge 1 commit into
Conversation
…ct.toml All uv invocations use --no-config --config-file=uv.toml, which causes [tool.uv] configuration in pyproject.toml to be silently ignored for resolution purposes. Commit c7359e4 placed both [[tool.uv.index]] and [tool.uv.sources] in pyproject.toml, but indexes there are not used by uv during resolution, causing packages from private indexes to not be found. The fix splits configuration correctly between the two files: - [[index]] entries go in uv.toml (via ResolveConfig.uv_config()) where uv actually reads them for package resolution - [tool.uv.sources] stays in pyproject.toml since uv rejects [sources] in uv.toml - Indexes referenced by sources are also declared in pyproject.toml so uv can validate the name references Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This yields a warning This is OK in practice since we know that the index entries in both are identical, and we only put them in pyproject.toml so that validation of sources works, but it's a bit of a smell. Let me think on this some more. |
|
OK, looks like with It seems that |
|
But weirdly I can't actually reproduce this. In manual testing directly with uv it seems happy to read the indexes from pyproject.toml even with |
All uv invocations use --no-config --config-file=uv.toml, which causes [tool.uv] configuration in pyproject.toml to be silently ignored for resolution purposes. Commit c7359e4 placed both [[tool.uv.index]] and [tool.uv.sources] in pyproject.toml, but indexes there are not used by uv during resolution, causing packages from private indexes to not be found.
The fix splits configuration correctly between the two files: