-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
uv init
should not create nested workspace
#5293
Conversation
0f9f37d
to
b4ca107
Compare
crates/uv-workspace/src/workspace.rs
Outdated
None | ||
} | ||
}) | ||
.expect("workspace root member must exist") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this true for a virtual workspaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, every workspace has a root member, either explicit or implicit.
@@ -53,7 +53,7 @@ pub(crate) async fn init( | |||
.unwrap_or_else(|_| path.simplified().to_path_buf()); | |||
|
|||
anyhow::bail!( | |||
"Project is already initialized in {}", | |||
"Project is already initialized in `{}`", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'm not sure about backticks around the inner colored text. I don't think we have a consistent style-guide for this, but is the color not sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do, actually #5209 covers use of backticks in these cases. We want the output to be readable in colorless contexts too.
I'm about to change this code so gonna tweak and merge this. I think this still doesn't work for virtual workspaces as-is. |
0b71591
to
d999306
Compare
@@ -62,6 +62,8 @@ pub struct Workspace { | |||
/// | |||
/// This table is overridden by the project sources. | |||
sources: BTreeMap<PackageName, Source>, | |||
/// The `pyproject.toml` of the workspace root. | |||
pyproject_toml: PyProjectToml, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@konstin - Any reason not to include this? It could be the same as the root member, but for virtual workspaces I can't see another way to get it.
Summary
Resolves #5251