Repository navigation
fix(python): leave out an index file pnpm cannot read - #14946
Conversation
Reading a distribution's candidates failed the whole page when one file it lists could not be read: an unreadable wheel filename, a file with no SHA-256 digest, a URL that is not HTTP(S), or a wheel belonging to another distribution. A page lists every release a distribution ever published, so one such file put the distribution out of reach at every version, including the versions a project can install. Such a file is now left out, with a debug log naming it and the reason, the way a wheel built for another interpreter already is. uv skips a file it cannot read the same way. What a lockfile pins keeps its hard errors: a pinned wheel pnpm cannot read is still refused rather than skipped.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe Python resolver now skips unusable index files instead of failing candidate collection. It logs skip reasons, retains valid wheels, adds test coverage, and records patch releases for ChangesPython index candidate filtering
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant candidates_from_page
participant installable_candidate
participant unusable
candidates_from_page->>installable_candidate: Evaluate each IndexFile
installable_candidate->>unusable: Log invalid file and return None
unusable-->>candidates_from_page: Skip file
installable_candidate-->>candidates_from_page: Return valid Candidate
Suggested labels: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk was established from the available evidence. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoSkip unusable files when resolving Python index candidates
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. One helper comment repeats its body
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Micro-Benchmark ResultsLinux |
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.35384506626,
"stddev": 0.14574171376537637,
"median": 2.2769185515599997,
"user": 1.20967672,
"system": 1.3740681,
"min": 2.2385152540599997,
"max": 2.61301898406
},
{
"command": "pacquet@main",
"mean": 2.33390853926,
"stddev": 0.10662477818026872,
"median": 2.28915980806,
"user": 1.23362812,
"system": 1.3692109000000001,
"min": 2.23619255206,
"max": 2.4998394620599997
},
{
"command": "pnpr@HEAD",
"mean": 1.4012176451599998,
"stddev": 0.11187188650869895,
"median": 1.3520111370599999,
"user": 1.14893222,
"system": 1.2635067,
"min": 1.2805388840599998,
"max": 1.61620896206
},
{
"command": "pnpr@main",
"mean": 1.41356804986,
"stddev": 0.06580446474779686,
"median": 1.43678261406,
"user": 1.15286362,
"system": 1.3447482,
"min": 1.31120868406,
"max": 1.48093435706
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22151669476000002,
"stddev": 0.015310327031669142,
"median": 0.22193413986000002,
"user": 0.22687687999999998,
"system": 0.5543466199999999,
"min": 0.19476247236000002,
"max": 0.25097641836
},
{
"command": "pacquet@main",
"mean": 0.31627265146,
"stddev": 0.04338473018095578,
"median": 0.31228747885999997,
"user": 0.3492404799999999,
"system": 0.7174591199999998,
"min": 0.22961691936000003,
"max": 0.39547993536000003
},
{
"command": "pnpr@HEAD",
"mean": 0.23377156226,
"stddev": 0.017634069578823543,
"median": 0.23568985836000003,
"user": 0.23069107999999994,
"system": 0.53018912,
"min": 0.20989307236000002,
"max": 0.25785427236
},
{
"command": "pnpr@main",
"mean": 0.22947453975999998,
"stddev": 0.006915084147470453,
"median": 0.22962349336000004,
"user": 0.22757188,
"system": 0.5449507199999999,
"min": 0.21577964436000002,
"max": 0.24005803036000004
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.00697073875185929,
"stddev": 0.0012334068207023436,
"median": 0.00669895838,
"user": 0.004393161306532664,
"system": 0.003012196180904523,
"min": 0.00548972038,
"max": 0.014159178380000002
},
{
"command": "pacquet@main",
"mean": 0.006106265677619047,
"stddev": 0.0004953219970157015,
"median": 0.00601628788,
"user": 0.003979861904761905,
"system": 0.00253780838095238,
"min": 0.00529344138,
"max": 0.009084855380000001
},
{
"command": "pnpr@HEAD",
"mean": 0.0059467556956626436,
"stddev": 0.00039650083519659595,
"median": 0.00588515138,
"user": 0.003949244578313256,
"system": 0.002390271325301205,
"min": 0.00525039138,
"max": 0.008036709380000001
},
{
"command": "pnpr@main",
"mean": 0.005785284494143923,
"stddev": 0.00024278074447538415,
"median": 0.00578702738,
"user": 0.003384282133995038,
"system": 0.0027586578660049638,
"min": 0.0052268463800000005,
"max": 0.0070896123800000006
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.00909216483416058,
"stddev": 0.001134055251352377,
"median": 0.008937655440000001,
"user": 0.005162771532846712,
"system": 0.004578770145985402,
"min": 0.00690846944,
"max": 0.01386289344
},
{
"command": "pacquet@main",
"mean": 0.008009300736428573,
"stddev": 0.0006635922523543273,
"median": 0.00791296144,
"user": 0.004433321428571431,
"system": 0.004185561285714284,
"min": 0.00668949044,
"max": 0.01168597844
},
{
"command": "pnpr@HEAD",
"mean": 0.007991691556363626,
"stddev": 0.0006778240133311582,
"median": 0.00783494744,
"user": 0.004783709090909092,
"system": 0.003793042690909091,
"min": 0.0067610794400000005,
"max": 0.01071747044
},
{
"command": "pnpr@main",
"mean": 0.008040586432125985,
"stddev": 0.0006095210699703839,
"median": 0.00794133144,
"user": 0.004740151181102355,
"system": 0.0038482943307086618,
"min": 0.00681602944,
"max": 0.01085711044
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.61466514232,
"stddev": 0.14200942573450417,
"median": 2.54788771422,
"user": 2.18323102,
"system": 2.2998181200000003,
"min": 2.52341944272,
"max": 2.9261749037199998
},
{
"command": "pacquet@main",
"mean": 2.5481054290199996,
"stddev": 0.012693757057074088,
"median": 2.55188935522,
"user": 2.10793952,
"system": 1.99233792,
"min": 2.5309472077199997,
"max": 2.5620962177199997
},
{
"command": "pnpr@HEAD",
"mean": 1.5521964401200001,
"stddev": 0.13315565277171468,
"median": 1.54234277772,
"user": 1.3117562200000001,
"system": 1.65167182,
"min": 1.4193066917200001,
"max": 1.7904518117200001
},
{
"command": "pnpr@main",
"mean": 1.54288337302,
"stddev": 0.11588419899264185,
"median": 1.49635141172,
"user": 1.31007952,
"system": 1.7296781200000002,
"min": 1.43679022272,
"max": 1.78187074372
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36145543706000005,
"stddev": 0.019292692856947367,
"median": 0.36190064056,
"user": 0.5951976999999998,
"system": 0.7670828999999999,
"min": 0.31739233556,
"max": 0.39583966156
},
{
"command": "pacquet@main",
"mean": 0.33389808386,
"stddev": 0.016152578057027245,
"median": 0.33043534856,
"user": 0.526206,
"system": 0.7555927,
"min": 0.31452925255999997,
"max": 0.37585861756
},
{
"command": "pnpr@HEAD",
"mean": 0.25436591325999997,
"stddev": 0.0078413410240586,
"median": 0.25466824256,
"user": 0.1874127,
"system": 0.49453629999999993,
"min": 0.24311805456000002,
"max": 0.26630999156
},
{
"command": "pnpr@main",
"mean": 0.26525628206,
"stddev": 0.01457677489096961,
"median": 0.26514319156,
"user": 0.21719150000000004,
"system": 0.4917962,
"min": 0.24473363856000002,
"max": 0.29721968556
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.5443372083800002,
"stddev": 0.019062244549484332,
"median": 1.54721309938,
"user": 0.8018442400000001,
"system": 0.8743916800000001,
"min": 1.5010516923800001,
"max": 1.56209793538
},
{
"command": "pacquet@main",
"mean": 1.5385453320800002,
"stddev": 0.009046726688920924,
"median": 1.53510272088,
"user": 0.80985224,
"system": 0.88630228,
"min": 1.5274449993800001,
"max": 1.5511872473800001
},
{
"command": "pnpr@HEAD",
"mean": 0.27686596298,
"stddev": 0.013962108575495008,
"median": 0.27886337038000003,
"user": 0.22100413999999996,
"system": 0.5208761799999999,
"min": 0.25728030038000005,
"max": 0.30477118538000003
},
{
"command": "pnpr@main",
"mean": 0.2768426541800001,
"stddev": 0.007956728595069639,
"median": 0.27660809988,
"user": 0.22012424,
"system": 0.5274343800000001,
"min": 0.26262061038,
"max": 0.28930211138
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23931375801,
"stddev": 0.01477815290023244,
"median": 0.23908393926,
"user": 0.24013179000000004,
"system": 0.10094777999999999,
"min": 0.21893973526000002,
"max": 0.27663177526
},
{
"command": "pacquet@main",
"mean": 0.22580296934333333,
"stddev": 0.00840906523958919,
"median": 0.22882645176,
"user": 0.2411377066666667,
"system": 0.08812503,
"min": 0.21170841526,
"max": 0.23928621926000002
},
{
"command": "pnpr@HEAD",
"mean": 0.09515653611714285,
"stddev": 0.002987778933335582,
"median": 0.09499656276,
"user": 0.038687789999999986,
"system": 0.01705420857142857,
"min": 0.09032305026,
"max": 0.10172118926
},
{
"command": "pnpr@main",
"mean": 0.09674083043857142,
"stddev": 0.0023290606715109193,
"median": 0.09586237976,
"user": 0.03812328999999999,
"system": 0.017471109285714288,
"min": 0.09377315126,
"max": 0.10284746626
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6670051338133334,
"stddev": 0.08730686767485069,
"median": 0.64673522748,
"user": 0.6998341688888888,
"system": 0.14945659777777773,
"min": 0.56609063548,
"max": 0.81085963248
},
{
"command": "pacquet@main",
"mean": 0.70703638948,
"stddev": 0.04138533163881658,
"median": 0.7048736844800001,
"user": 0.7309051688888888,
"system": 0.14738648666666665,
"min": 0.6390679344800001,
"max": 0.7709857104800001
},
{
"command": "pnpm@HEAD",
"mean": 3.0024325533688887,
"stddev": 0.08331070039451476,
"median": 2.99962268248,
"user": 4.643733391111111,
"system": 0.22880770888888888,
"min": 2.83640195948,
"max": 3.15910991148
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.19384208293333335,
"stddev": 0.006157241701039373,
"median": 0.1907373724,
"user": 0.14516441333333335,
"system": 0.10527160666666667,
"min": 0.1881003884,
"max": 0.2050187224
},
{
"command": "pacquet@main",
"mean": 0.1966357879333333,
"stddev": 0.00717372384057069,
"median": 0.1987943794,
"user": 0.14938401333333334,
"system": 0.10480694,
"min": 0.1858687244,
"max": 0.2049712134
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.58207770762,
"stddev": 0.1934302450407947,
"median": 4.539383061420001,
"user": 1.6440190599999998,
"system": 2.1656740599999997,
"min": 4.37466801492,
"max": 4.96340607992
},
{
"command": "pacquet@main",
"mean": 4.4371451660200005,
"stddev": 0.08603487701836943,
"median": 4.42600428392,
"user": 1.60184356,
"system": 2.0022871600000003,
"min": 4.33654775992,
"max": 4.6332391499200005
},
{
"command": "pnpr@HEAD",
"mean": 3.50681134372,
"stddev": 0.06678336062836927,
"median": 3.48567905342,
"user": 1.59767306,
"system": 1.9508375599999996,
"min": 3.40600627292,
"max": 3.61951020392
},
{
"command": "pnpr@main",
"mean": 3.4782026097200003,
"stddev": 0.0859276403866639,
"median": 3.44122869992,
"user": 1.4888647599999998,
"system": 1.9283730600000002,
"min": 3.38905612892,
"max": 3.61090026392
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.10154617191565216,
"stddev": 0.007755543361711471,
"median": 0.10099123922000001,
"user": 0.12623158869565218,
"system": 0.12816898695652174,
"min": 0.08976983022000001,
"max": 0.12083536322000002
},
{
"command": "pacquet@main",
"mean": 0.10544557784500003,
"stddev": 0.006481642346715709,
"median": 0.10423804172000001,
"user": 0.12903922999999998,
"system": 0.1390986916666667,
"min": 0.09685576722000001,
"max": 0.12168495622000002
},
{
"command": "pnpr@HEAD",
"mean": 0.11717595791565216,
"stddev": 0.00573146471834433,
"median": 0.11523824822,
"user": 0.13918763217391303,
"system": 0.1293606391304348,
"min": 0.10925998822,
"max": 0.12979569322
},
{
"command": "pnpr@main",
"mean": 0.12396773683904765,
"stddev": 0.008757398749738285,
"median": 0.12216756422000001,
"user": 0.14754426571428575,
"system": 0.12993428095238096,
"min": 0.11454700522000001,
"max": 0.14620868222000002
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/14946 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 109.26 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,419.31 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 257.28 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 243.12 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 90.32 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,280.54 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,406.01 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 209.89 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 6.76 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 5.25 ms |
) A wheel whose `Requires-Dist` pnpm cannot parse failed the whole resolution, so one broken release took its distribution down at every version the project could otherwise install. The release is immutable, so nothing the project does corrects it. Such a release is now unavailable to the solver, which backtracks to one whose requirements pnpm can read, and reports the unreadable requirement when no release works. uv marks a version with unreadable metadata unavailable the same way. The direct-URL form keeps its error. `read_requirement` tells a line pnpm cannot parse apart from one it parses and does not support: every release declaring a URL requirement names the same unsupported feature, so quietly installing an older release would hide what the project has to change. `parse_requirement`, which reads what a project itself declares, is unchanged. Follows up #14946.
Reading a distribution's candidates failed the whole page when one file it lists could not be read: an unreadable wheel filename, a file with no SHA-256 digest, a URL that is not HTTP(S), or a wheel belonging to another distribution. A page lists every release a distribution ever published, so one such file put the distribution out of reach at every version, including the versions a project can install. Such a file is now left out, with a debug log naming it and the reason, the way a wheel built for another interpreter already is. uv skips a file it cannot read the same way. What a lockfile pins keeps its hard errors: a pinned wheel pnpm cannot read is still refused rather than skipped. Follows up pnpm#14920.
…m#14948) A wheel whose `Requires-Dist` pnpm cannot parse failed the whole resolution, so one broken release took its distribution down at every version the project could otherwise install. The release is immutable, so nothing the project does corrects it. Such a release is now unavailable to the solver, which backtracks to one whose requirements pnpm can read, and reports the unreadable requirement when no release works. uv marks a version with unreadable metadata unavailable the same way. The direct-URL form keeps its error. `read_requirement` tells a line pnpm cannot parse apart from one it parses and does not support: every release declaring a URL requirement names the same unsupported feature, so quietly installing an older release would hide what the project has to change. `parse_requirement`, which reads what a project itself declares, is unchanged. Follows up pnpm#14946.
Summary
Follow-up to #14920, which stopped an unparsable
Requires-Pythonfrom aborting Python resolution. The same shape of failure is still reachable through four other readings of an index page. Reading a distribution's candidates fails the whole page when any single file it lists cannot be read:demo-4.0.0-py3-none.whl(filename with too few parts)invalid Python wheel filename: demo-4.0.0-py3-none.whlhashescarry no SHA-256Python wheel demo-2.0.0-py3-none-any.whl has no SHA-256 digestPython artifacts require HTTP(S) URLs without embedded credentialsPython index for demo contains a wheel for otherA Simple API page lists every release a distribution ever published, so one such file puts the distribution out of reach at every version, including the versions the project can install. The releases are immutable, so nothing the project does corrects them.
Each of these files is now left out, with a debug log naming the file and the reason, the way a wheel built for another interpreter already is. Refusing the file is still refusing it: none of them was installable, and pnpm never fetches an unverified or non-HTTP(S) artifact.
This is what uv does. In
crates/uv-client/src/registry_client.rsit drops the file and keeps the page:What a lockfile pins keeps its hard errors.
LockedWheel::check_installableandLockfile::seedstill refuse a pinned wheel pnpm cannot read, so a tampered or corruptpylock.tomlfails loudly instead of resolving to something else.Not included: a version whose
Requires-Distcannot be parsed still aborts the resolution instead of marking that version unavailable. It is the same principle, but it also covers requirements pnpm deliberately rejects, such as the direct-URL form, where a clear error beats silently resolving an older version. Worth its own change.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
pnpm installno longer fails when a Python package index contains unusable files, such as releases without SHA-256 checksums, invalid filenames, unsupported URLs, or mismatched package names.Tests