Skip to content

Avoid installing tool workspace member dependencies as editable#18891

Merged
charliermarsh merged 6 commits intomainfrom
charlie/tool-editable
Apr 14, 2026
Merged

Avoid installing tool workspace member dependencies as editable#18891
charliermarsh merged 6 commits intomainfrom
charlie/tool-editable

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Apr 7, 2026

Summary

Right now, if you use uv tool install, we install the tool itself as non-editable, but if the tool is part of a workspace, then any workspace dependencies are (accidentally) installed as editable. This PR modifies the behavior such that those dependencies are installed as non-editable, unless --editable is provided, in which case the tool itself and any workspace dependencies respect --editable.

Similar logic applies to --with and --with-editable. If the target is in a workspace, we propagate the no-editable and yes-editable flags (respectively) to its members.

Closes #16306

@charliermarsh charliermarsh added the bug Something isn't working label Apr 7, 2026
@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch 2 times, most recently from 06fbbf1 to b1dcae5 Compare April 7, 2026 02:31
@zanieb
Copy link
Copy Markdown
Member

zanieb commented Apr 7, 2026

In #16335, @konstin and I were advocating for not mutating this after the fact. What was your take on that?

@charliermarsh
Copy link
Copy Markdown
Member Author

That seems like a plausible approach. It's a bit odd because we already use this pattern everywhere else, but I agree that it's a bit simpler and easier to get right. I'll rework this PR.

@zanieb
Copy link
Copy Markdown
Member

zanieb commented Apr 7, 2026

I don't have strong feelings, I just explored an alternative approach and Konsti said he preferred it. I'd be curious if he feels strongly.

@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch 6 times, most recently from 29142a9 to 9824ab3 Compare April 8, 2026 14:43
@charliermarsh charliermarsh marked this pull request as ready for review April 8, 2026 16:08
@charliermarsh charliermarsh requested review from konstin and zanieb April 8, 2026 16:08
@charliermarsh charliermarsh marked this pull request as draft April 8, 2026 16:09
@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch 2 times, most recently from e765124 to af8267c Compare April 8, 2026 16:56
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 8, 2026

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing charlie/tool-editable (0c3d86d) with main (e0793d5)

Open in CodSpeed

@charliermarsh charliermarsh marked this pull request as ready for review April 8, 2026 17:55
@charliermarsh charliermarsh marked this pull request as draft April 8, 2026 19:48
@charliermarsh
Copy link
Copy Markdown
Member Author

I still need to remove the post-resolution rewrite here. It's surprisingly hard.

@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch 2 times, most recently from 7d9e8da to c0ed0c7 Compare April 9, 2026 00:56
@charliermarsh charliermarsh marked this pull request as ready for review April 9, 2026 01:20
@charliermarsh charliermarsh marked this pull request as draft April 9, 2026 01:21
@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch from c0ed0c7 to b6ca158 Compare April 9, 2026 01:40
@charliermarsh charliermarsh marked this pull request as ready for review April 9, 2026 01:40
@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch 2 times, most recently from 3e4d70d to edd77e0 Compare April 9, 2026 14:04
Comment thread crates/uv-types/src/traits.rs
Comment thread crates/uv-types/src/traits.rs Outdated
Comment thread crates/uv/src/commands/project/sync.rs
Comment thread crates/uv-distribution/src/metadata/lowering.rs Outdated
Comment thread crates/uv/src/commands/tool/common.rs Outdated
Comment thread crates/uv/src/commands/tool/common.rs Outdated
@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch from edd77e0 to 4e2803e Compare April 13, 2026 17:42
@charliermarsh charliermarsh requested a review from konstin April 13, 2026 17:53
@charliermarsh charliermarsh force-pushed the charlie/tool-editable branch from 4e2803e to 0c3d86d Compare April 14, 2026 13:49
Copy link
Copy Markdown
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much leaner now!

@charliermarsh
Copy link
Copy Markdown
Member Author

Thanks for your patience!

@charliermarsh charliermarsh merged commit 92222f0 into main Apr 14, 2026
45 of 47 checks passed
@charliermarsh charliermarsh deleted the charlie/tool-editable branch April 14, 2026 14:01
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Apr 16, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [uv](https://github.com/astral-sh/uv) | patch | `0.11.6` → `0.11.7` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (uv)</summary>

### [`v0.11.7`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0117)

[Compare Source](astral-sh/uv@0.11.6...0.11.7)

Released on 2026-04-15.

##### Python

- Upgrade CPython build to [`2026041`](astral-sh/uv@20260414) including an OpenSSL security upgrade ([#&#8203;19004](astral-sh/uv#19004))

##### Enhancements

- Elevate configuration errors to `required-version` mismatches ([#&#8203;18977](astral-sh/uv#18977))
- Further improve TLS certificate validation messages ([#&#8203;18933](astral-sh/uv#18933))
- Improve `--exclude-newer` hints  ([#&#8203;18952](astral-sh/uv#18952))

##### Preview features

- Fix `--script` handling in `uv audit` ([#&#8203;18970](astral-sh/uv#18970))
- Fix traversal of extras in `uv audit` ([#&#8203;18970](astral-sh/uv#18970))

##### Bug fixes

- De-quote `workspace metadata` in linehaul data ([#&#8203;18966](astral-sh/uv#18966))
- Avoid installing tool workspace member dependencies as editable ([#&#8203;18891](astral-sh/uv#18891))
- Emit JSON report for `uv sync --check` failures ([#&#8203;18976](astral-sh/uv#18976))
- Filter and warn on invalid TLS certificates ([#&#8203;18951](astral-sh/uv#18951))
- Fix equality comparisons for version specifiers with `~=` operators ([#&#8203;18960](astral-sh/uv#18960))
- Fix stale Python upgrade preview feature check in project environment construction ([#&#8203;18961](astral-sh/uv#18961))
- Improve Windows path normalization ([#&#8203;18945](astral-sh/uv#18945))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants