Skip to content
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

Merged
merged 6 commits into from
Jul 22, 2024

Conversation

j178
Copy link
Contributor

@j178 j178 commented Jul 22, 2024

Summary

Resolves #5251

@j178 j178 force-pushed the init-nested branch 3 times, most recently from 0f9f37d to b4ca107 Compare July 22, 2024 16:29
@zanieb zanieb requested a review from ibraheemdev July 22, 2024 16:35
None
}
})
.expect("workspace root member must exist")
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@j178 j178 marked this pull request as ready for review July 22, 2024 21:25
@@ -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 `{}`",
Copy link
Member

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?

Copy link
Member

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.

@charliermarsh
Copy link
Member

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.

@@ -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,
Copy link
Member

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.

@charliermarsh charliermarsh enabled auto-merge (squash) July 22, 2024 23:43
@charliermarsh charliermarsh merged commit d232bfe into astral-sh:main Jul 22, 2024
54 checks passed
@j178 j178 deleted the init-nested branch July 23, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should uv init create nested workspaces?
5 participants