Repository navigation
Centralize direct URL metadata reading - #22644
Conversation
uv test inventory changesThis PR changes the tests when compared with the
|
Merging this PR will improve performance by 9.21%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ |
Simulation | discover_workspace_from_all_members_with_excludes |
165.6 ms | 141.8 ms | +16.78% |
| ⚡ |
Simulation | discover_workspace_from_all_members |
151.5 ms | 142.9 ms | +6.06% |
| ⚡ | WallTime | git_fetch_cold_precise[sampleproject] |
38.4 ms | 36.5 ms | +5.17% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing zaniebot/direct-url-reader-20261016 (2f16c64) with main (64e2ac8)
Footnotes
-
54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
`DirectUrl` stores a VCS repository URL and its metadata as separate fields, and both Git source conversions construct the same metadata. Group them in `VcsUrl` and share the conversion from `GitUrl`. Keep the serialized `direct_url.json` shape and URL parsing behavior unchanged. Stacked on #22644. Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
Other installers can write
direct_url.jsonmetadata containing URLs that uv cannot parse, as Poetry did with SCP-style Git addresses (#1793). uv warns and treats an affected installation as a registry distribution, allowing commands such asuv pip freezeto inspect the environment.Parsing URLs during Serde deserialization would combine URL failures with JSON and schema errors. Add a reader that decodes metadata before parsing its URL, returning the metadata and reconstructed URL with distinct errors. This lets #22646 use
SafeUrl<Stripped>fields while retaining that fallback; malformed JSON and schema mismatches remain errors.