fix(manager/pep621): support array form of tool.uv.sources - #44970
Open
ntsk wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Reported in #44948
uv allows
tool.uv.sourcesentries to be written as an array of sources, disambiguated by environment markers. A single-element array is valid too.The pep621 schema only accepted the single-table form, and
LooseRecordsilently drops entries it can't parse, so array-form sources were ignored and lookups fell back to pypi.org.For packages that only exist on the declared index this shows up as
WARN: Package lookup failures.For packages that also exist on pypi.org the problem is harder to notice: there is no warning, and Renovate silently proposes versions from the wrong registry.
What this PR does:
sourcesnow accepts a single source or an array of sources, normalized to an arrayregistryUrls(the pypi datasource merges releases across registries). A single non-index source behaves exactly as before.skipReason: 'unsupported'. Renovate can't represent them as a single update, and skipping is still better than the previous behavior of silently looking up pypi.org.One thing this PR does not attempt: when markers don't cover every environment, uv falls back to the default index for the rest. Renovate doesn't evaluate markers, and the existing single-table handling has the same simplification, so I kept that behavior.
Context
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: https://github.com/ntsk/reproduce-array-form-uv-sources
The repo pins a package that only exists on test.pypi.org to a custom index using the array form.
With this branch (
node lib/renovate.ts --platform=localin that repo):and the lookup failure is gone.