Skip to content

Centralize direct URL metadata reading - #22644

Merged
zanieb merged 1 commit into
mainfrom
zaniebot/direct-url-reader-20261016
Oct 16, 2026
Merged

zanieb merged 1 commit into
mainfrom
zaniebot/direct-url-reader-20261016

Conversation

@astral-automations-bot

@astral-automations-bot astral-automations-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Other installers can write direct_url.json metadata 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 as uv pip freeze to 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.

@astral-sh-bot

astral-sh-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the main base revision.

  • Added tests: 4
  • Removed tests: 0
  • Changed suites: 1
uv::pip: +4 / -0

Added:

  • uv::pip::pip_list::list_ambiguous_direct_url
  • uv::pip::pip_list::list_invalid_direct_url
  • uv::pip::pip_list::list_invalid_direct_url_json
  • uv::pip::pip_list::list_invalid_direct_url_metadata

Removed: none

@codspeed

codspeed Bot commented Oct 16, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 9.21%

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
✅ 66 untouched benchmarks
⏩ 54 skipped benchmarks1

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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. ↩

@zanieb
zanieb requested a review from charliermarsh October 16, 2026 18:06
@zanieb
zanieb merged commit 862ab74 into main Oct 16, 2026
125 checks passed
@zanieb
zanieb deleted the zaniebot/direct-url-reader-20261016 branch October 16, 2026 18:51
zanieb pushed a commit that referenced this pull request Oct 16, 2026
`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>

This branch was previously deployed

1 inactive deployment
automations — 2f16c64f Deployed Oct 16, 2026 by astral-automations-bot[bot] via review / security review #51363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants