-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should uv sync
sync the full workspace by default?
#5727
Comments
There are a few different cases to consider...
|
Does this mean that all workspace requirements would no longer need to be explicit? |
I think it'd be something like:
|
I have a minor concern that |
In general |
This has come up a few times so leaving it open for more discussion. |
I guess a good default behavior is to take a light touch, so maybe not Perhaps we can add a CLI/config arg to |
Hmm.. I'd suggest the opposite -- that the good default behaviour is the least surprising one. If I've set up a workspace, I've explicitly declared "I'm going to be working with all of these members". It's very strange that |
I would argue that it would also be surprising, though, if any package could import any other package regardless of whether it was declared as a dependency, which is what would be enabled if we synced the entire workspace by default. We would lose any sort of enforcement of module boundaries. |
But don't you end up in that state anyway, once you've synced multiple members of the workspace? e.g. from what you said above -- |
|
I think that makes workspaces much less useful. For example, the comfyui/plugins scenario can't be supported reasonably. Ideally, I'd want to specify extras as a global thing for the workspace. In other words, I wouldn't have the ability to run workspace member
it shouldn't be up to Edit: at the very least, an option to do this (sync everything) that can be set in the workspace root would be helpful. Then the actual default doesn't matter much. |
I completely missed the mention of "virtual workspace" vs. project in the initial post here. (There's also no mention of "virtual workspace" on https://docs.astral.sh/uv/concepts/workspaces/) If I just remove the |
The “virtual workspace” concept isn’t present in the docs because they’re considered legacy. We removed them in favor of non-packaged projects (projects without a build system), which you can find in the docs. |
Ah ok. Please don't remove them even if legacy until there's another way to get the full-workspace sync behaviour -- it's the only way to make this work right now. non-packaged projects trigger the "sync just the project" behaviour. |
You can now use |
Great, thank you! Is there a way to set this in the workspace pyproject file, so that it doesn't need to be passed in as a command line argument? |
If you have a virtual workspace, we do this. But for non-virtual workspaces, we sync the workspace root. It's a little bit of a footgun (see, e.g., astral-sh/ruff#12622 (comment)).
The text was updated successfully, but these errors were encountered: