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

Should uv init create nested workspaces? #5251

Closed
j178 opened this issue Jul 20, 2024 · 1 comment · Fixed by #5293
Closed

Should uv init create nested workspaces? #5251

j178 opened this issue Jul 20, 2024 · 1 comment · Fixed by #5293
Labels
bug Something isn't working good first issue Good for newcomers preview Experimental behavior

Comments

@j178
Copy link
Contributor

j178 commented Jul 20, 2024

$ uv init work
Initialized project work in /tmp/work
$ uv init work/pkg-a
Adding pkg-a as member of workspace /tmp/work
Initialized project pkg-a in /tmp/work/pkg-a
$ uv init work/pkg-a/pkg-inside-a
Adding pkg-inside-a as member of workspace /tmp/work
Initialized project pkg-inside-a in /tmp/work/pkg-a/pkg-inside-a

Content of work/pyproject.toml:

[project]
name = "work"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
dependencies = []

[tool.uv]
dev-dependencies = []

[tool.uv.workspace]
members = ["pkg-a"]

Content of work/pkg-a/pyproject.toml:

[project]
name = "pkg-a"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
dependencies = []

[tool.uv]
dev-dependencies = []

[tool.uv.workspace]
members = ["pkg-inside-a"]

The message from uv init work/pkg-a/pkg-inside-a indicates Adding pkg-inside-a as member of workspace /tmp/work. However it seems to be added to /tmp/work/pkg-inside-a, essentially creating a workspace inside a workspace. Do we allow a workspace member itself being a workspace?

@konstin konstin added the bug Something isn't working label Jul 22, 2024
@konstin
Copy link
Member

konstin commented Jul 22, 2024

That's a bug, we should add pkg-inside-a to the workspace root at work/pyproject.toml and error when there's a workspace declaration in a workspace member.

@konstin konstin added good first issue Good for newcomers preview Experimental behavior labels Jul 22, 2024
charliermarsh pushed a commit that referenced this issue Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers preview Experimental behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants