
3 Things I Wish I Knew Before Setting Up a UV Workspace
I love uv , it's so much better than pip , but I'm still learning the ins and outs. Today I was setting up a Python monorepo with uv workspaces and ran into a few issues, the fixes of which were trivial once I knew about them. 1. Give the Root a Distinct Name First, a virtual root ( package = false ) still needs a [project] name - and it can't match any member package. I had both the root and my core package using the same name, e.g. my-app : my-app/ # workspace root pyproject.toml # name = "my-app" <- problem! packages/ core/ pyproject.toml # name = "my-app" src/core/ cli/ pyproject.toml # name = "my-app-cli" src/cli/ When I ran uv sync , it refused outright: $ uv sync error: Two workspace members are both named `my-app`: `/path/to/my-app` and `/path/to/my-app/packages/core` Even though the root has package = false , uv still registers its name as a workspace member identity. Same name, two members, no way to disambiguate. The fix - give the root a workspace-specific name: # Root pypr
Continue reading on Dev.to Python
Opens in a new tab


