Skip to content

Omit workspace members for --no-sources commands#18859

Open
charliermarsh wants to merge 1 commit intomainfrom
charlie/no-sources
Open

Omit workspace members for --no-sources commands#18859
charliermarsh wants to merge 1 commit intomainfrom
charlie/no-sources

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Apr 5, 2026

Summary

In uv sync and friends, even with --no-sources, we discover all the workspace members and send them in as local editable dependencies before we even hit lowering. This PR filters them out during discovery.

Honestly, I'm not sure if we want this behavior. It means that if you have a member that depends on a workspace member, and that dependency isn't available through another source (e.g., from PyPI), resolution will fail with --no-sources, since we'll ignore workspace = true. But if we don't have this behavior, then we can't plausibly support replacing workspace dependencies with other dependencies via --no-sources as described in #18258. Semantically, though, ignoring workspace = true does seem correct, and --no-sources-package exists for more targeted usages.

Closes #18258.

@charliermarsh charliermarsh added bug Something isn't working breaking A breaking change labels Apr 5, 2026
@charliermarsh charliermarsh marked this pull request as ready for review April 5, 2026 18:47
@zanieb
Copy link
Copy Markdown
Member

zanieb commented Apr 7, 2026

Hm while this is technically more consistent I'm pretty worried it's not actually desirable. I'll try to think of an alternative.

@charliermarsh
Copy link
Copy Markdown
Member Author

I think the thing we need to figure out is: if we always enforce that workspace dependencies are resolved to workspace members, is there a supported way to patch or override them? I'm concerned that we've probably recommended this exact approach in the past to solve that problem.

@zanieb
Copy link
Copy Markdown
Member

zanieb commented Apr 7, 2026

Separately from the existing behavior, I think I might expect --no-workspace to do that.

@charliermarsh
Copy link
Copy Markdown
Member Author

charliermarsh commented Apr 7, 2026

(To be clear, I'm not sold on this change either -- oh, I guess I said this in the summary. I mostly care that the behavior is consistent between commands...)

@charliermarsh charliermarsh requested a review from zanieb April 7, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A breaking change bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent behavior of --no-sources in uv sync and uv pip compile with workspace

2 participants