Skip to content

Fix: uv tool install installs workspace members non‑editable by default; --editable to opt‑in#16335

Open
krishmas wants to merge 11 commits intoastral-sh:mainfrom
krishmas:krish/tool3
Open

Fix: uv tool install installs workspace members non‑editable by default; --editable to opt‑in#16335
krishmas wants to merge 11 commits intoastral-sh:mainfrom
krishmas:krish/tool3

Conversation

@krishmas
Copy link
Copy Markdown

Summary

Resolves #16306

  • Default non‑editable for workspace deps in tool installs
    • Tools no longer get editable .pth links to workspace members; installs are self‑contained.
    • Passing --editable makes both the target package and workspace members editable.
  • Share editable conversion across commands
    • Move editable conversion into apply_editable_mode and reuse from both sync and tool install

Test Plan

  • Tool install integration tests
    • Default non‑editable workspace member (tool_install::tool_install_no_editable_workspace_member):
    • Explicit --editable (tool_install::tool_install_workspace_editable):
  • Locally used built uv with the Python project mentioned in Workspace members are installed as editable during uv tool install ./project #16306 and observed that changes to workspace dependency source code no longer changed tool behavior unless --editable was used

@krishmas krishmas marked this pull request as ready for review October 17, 2025 07:53
@krishmas krishmas marked this pull request as draft October 17, 2025 07:53
@krishmas krishmas marked this pull request as ready for review October 17, 2025 08:24
@konstin konstin requested a review from zanieb October 20, 2025 09:35
@konstin konstin added enhancement New feature or improvement to existing functionality breaking A breaking change labels Oct 20, 2025
@krishmas
Copy link
Copy Markdown
Author

Hi @zanieb , would it be possible to get a review here? 🙏

@zanieb
Copy link
Copy Markdown
Member

zanieb commented Oct 23, 2025

I spent a bit of time exploring an alternative (mostly guiding Claude) and was considering something more of the flavor here https://github.com/astral-sh/uv/compare/zb/tool-workspace

I'm not sure which is best yet, I'll try to find time to look closer but my time is elsewhere right now.

@krishmas
Copy link
Copy Markdown
Author

Hi @zanieb , just wanted to ping again - anything I can do to help out here?

@krishmas
Copy link
Copy Markdown
Author

@zanieb just bumping this again - lmk your thoughts. Happy to stop pinging if this is still something you want to think about more before merging this in.

@zanieb
Copy link
Copy Markdown
Member

zanieb commented Nov 20, 2025

I haven't had a chance to look further. I'm pretty sure the approach in #16335 (comment) makes more sense, but maybe @konstin can confirm he agrees before you pursue that?

@konstin
Copy link
Copy Markdown
Member

konstin commented Nov 24, 2025

The approach in https://github.com/astral-sh/uv/compare/zb/tool-workspace makes more sense to me: We should decide before doing the resolution if the default for workspace packages should be editable or non-editable, instead of changing this after the resolution is done.

There's also the question whether we want to expose inheriting the workspace editable state to users (like path = "foo", editable = "workspace"), but that's a second or third step.

@krishmas
Copy link
Copy Markdown
Author

Great thanks @zanieb @konstin ! I'll try to take a stab when I get some time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A breaking change enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants