Skip to content

Explain ambiguous non-workspace packages in frozen sync - #1128

Draft
zaniebot wants to merge 4 commits into
mainfrom
zb/explain-frozen-workspace-package
Draft

zaniebot wants to merge 4 commits into
mainfrom
zb/explain-frozen-workspace-package

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

With uv sync --frozen --package, selecting a dependency that has multiple locked versions reports an ambiguous package without explaining that it is not a workspace member. Use the lockfile’s recorded members and implicit root to add that context to this existing error, retaining the original cause. Frozen sync still works without member pyproject.toml files, and other package selections are unchanged. Fixes astral-sh#16247.

@astral-automations-bot astral-automations-bot Bot added the area:error-messages Messaging when something goes wrong label Sep 9, 2026
@zaniebot zaniebot added priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect. risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. labels Sep 10, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/explain-frozen-workspace-package branch from 540d6f2 to 6e43394 Compare September 11, 2026 19:00
@codspeed

codspeed Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 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

✅ 54 untouched benchmarks
⏩ 35 skipped benchmarks1


Comparing zb/explain-frozen-workspace-package (c10bb48) with main (238d6ba)

Open in CodSpeed

Footnotes

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

@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/explain-frozen-workspace-package branch from cc515dd to 4c33552 Compare October 7, 2026 22:19
Comment thread crates/uv/tests/sync/sync.rs Outdated
Comment on lines +2858 to +2861
sync()
.args(["--package", "root-project"])
.assert()
.success();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Exercise the implicit-root exception with an ambiguous root

Here root-project is unambiguous, so the successful sync never reaches the new lock-error handler. The following failing sync selects split-dependency, whose name differs from the root. Removing the new lock.root() guard would therefore leave every assertion passing. Add an omitted-members fixture with two packages named root-project, including the virtual package at ., and snapshot the original ambiguity error without the workspace context. This would protect the implicit-root exception.

@zaniebot
zaniebot deployed to automations October 9, 2026 00:32 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 9, 2026 00:35 — with GitHub Actions Active
Comment thread crates/uv/tests/sync/sync.rs Outdated
Comment on lines +2807 to +2813
let sync = || {
let mut command = context.sync();
command.args([
"--offline",
"--no-python-downloads",
"--frozen",
"--dry-run",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Keep regression command arguments explicit

This closure hides --frozen and --dry-run, the flags that determine the execution path being tested, so later assertions require tracing back to the wrapper to understand their scope. Nearby sync_frozen_member_default_groups and the new sync_frozen_ambiguous_implicit_root test put those arguments directly beside each snapshot. Use context.sync().args([...]) at each invocation so the regression conditions remain visible.

@zaniebot
zaniebot deployed to automations October 9, 2026 01:45 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 9, 2026 16:26 — with GitHub Actions Active
@zaniebot zaniebot added the project:maintainer-followups Maintainer follow-up work label Oct 9, 2026

This branch was successfully deployed

1 active deployment
automations — c10bb48c Deployed Oct 9, 2026 by zaniebot via review-code-quality / code quality review #8961
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:error-messages Messaging when something goes wrong priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. project:maintainer-followups Maintainer follow-up work risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message for --frozen --package with a non-workspace root

2 participants