Skip to content

Workspace members are installed as editable during uv tool install ./project #16306

@krishmas

Description

@krishmas

Question

I raised this as a related question in #12795 but figured this is a little different and deserved its own issue

I have a monorepo workspace structure with multiple projects that depend on shared libraries within the same workspace:

  monorepo/
  ├── pyproject.toml (workspace root)
  ├── projects/
  │   └── project_a/
  │       ├── pyproject.toml
  │       └── src/project_a/
  └── shared_libs/
      └── shared_lib_a/
          ├── pyproject.toml
          └── src/shared_lib_a/

Root pyproject.toml:

[tool.uv.workspace]
members = [
    "projects/project_a",
    "shared_libs/shared_lib_a"
]

[tool.uv.sources]
project_a = { workspace = true }
shared_lib_a = { workspace = true }

projects/project_a/pyproject.toml:

  [project]
  name = "project_a"
  dependencies = [
      "shared_lib_a"
  ]

  [project.scripts]
  project_a = "project_a.main:app"

  [build-system]
  requires = ["hatchling"]
  build-backend = "hatchling.build"

When I run uv tool install project_a, the installation creates a snapshot but only includes a .pth file linking back to shared_lib_a's source code. This means if I modify or delete shared_lib_a
after installation, the installed tool breaks.

Is there a way to make uv tool install include/vendor the workspace dependencies (shared_lib_a) into the tool installation so it's fully self-contained?

I basically want the installed tool to be independent of the workspace source code state, similar to how compiled binaries work in Go/Rust/etc where dependencies are bundled into the final artifact.

Platform

No response

Version

uv 0.7.8 (0ddcc19 2025-05-23)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions