Skip to content

repl: Use uv to install ipykernel for uv-managed venv#51897

Merged
probably-neb merged 3 commits intozed-industries:mainfrom
feitreim:bugfix-repl-uv
Apr 6, 2026
Merged

repl: Use uv to install ipykernel for uv-managed venv#51897
probably-neb merged 3 commits intozed-industries:mainfrom
feitreim:bugfix-repl-uv

Conversation

@feitreim
Copy link
Copy Markdown
Contributor

Context

Closes #51874

the repl is able to recognize that the venv is managed by uv, but still runs python -m pip install ipykernel, despite this not working. this PR fixes that behavior and uses uv to install ipkernel.

How to Review

Added a path that uses uv to install ipykernel in repl_editor.rs
Added a function to repl_store.rs that allows updating the venv as having ipykernel installed after installing it.

Videos

Old Behavior:

before.mov

New Behavior:

after.mov

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • repl: Fixed installing ipykernel with uv managed environements

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 19, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, cole-miller and kubkon and removed request for a team March 19, 2026 05:28
@zed-community-bot zed-community-bot bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Mar 19, 2026
@maxdeviant maxdeviant changed the title repl: When using a uv managed venv, use uv to install ipykernel repl: Use uv to install ipykernel for uv-managed venv Mar 19, 2026
cx.notify();
}

pub fn mark_ipykernel_installed(&mut self, cx: &mut Context<Self>, spec: &PythonEnvKernelSpecification) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the problem this function is solving, and why did adding the uv install path make this necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops I should have documented this better. This is admittedly a secondary bug that I just found while I was working on the uv thing, heres demo of the behavior before and after this change:

the actual behavior it fixes it that after installing the ipykernel, the repl isnt made aware of that, and it doesnt update the display, so you can just click on it again and it will 'reinstall' the kernel. worth noting that it doesn't actually effect the functionality, after the first install the kernel will work and you can run cells, it just isnt updating the UI properly.

Behavior Before:
https://github.com/user-attachments/assets/ec1134e5-637b-42cf-8e93-81fc4512de7f

Behavior After:
https://github.com/user-attachments/assets/7359f35e-0fb8-4fee-8160-165673ec219f

"pip",
"install",
"ipykernel",
"--python",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is the --python flag here necessary? I'm sorry, but I'm not too familiar with uv tooling flag details.

Copy link
Copy Markdown
Contributor Author

@feitreim feitreim Mar 19, 2026

Choose a reason for hiding this comment

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

I'm not 100% sure its necessary but its a nice extra way to ensure you're calling it on the correct python installation and not like a the global python install or something.

this should make it slightly more robust to things like trying to use a kernel with a uv managed venv that isn't the one in your project directory.

@miguelraz miguelraz requested review from miguelraz and probably-neb and removed request for cole-miller and kubkon March 19, 2026 15:30
@miguelraz miguelraz assigned probably-neb and unassigned kubkon Mar 19, 2026
swannysec added a commit that referenced this pull request Mar 19, 2026
## Context

The permissions ceiling bug (fixed in #51948) left two open PRs (#51897,
#50372) with failed `check-size` runs. The Check Runs API requires
GitHub App auth, so we can't post passing checks from the CLI — it needs
to run inside Actions with `checks: write`.

This adds a `workflow_dispatch` workflow that takes comma-separated PR
numbers, computes sizes, applies labels, and posts passing check runs.
Delete after use.

## How to Review

- Single file: `.github/workflows/fix-size-check.yml`
- Uses the same size logic and ignored patterns as `pr-size-check.yml`
- Input is `pr_numbers` (comma-separated integers), accessed via JS API,
not shell interpolation

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
@github-actions github-actions bot added size/S and removed size/S labels Mar 19, 2026
swannysec added a commit that referenced this pull request Mar 19, 2026
Both affected PRs (#51897, #50372) now have passing checks and correct
size labels. This workflow is no longer needed.
swannysec added a commit that referenced this pull request Mar 19, 2026
## Context

Cleanup of the one-off workflow added in #51958. Both affected PRs
(#51897, #50372) now have passing checks and correct size labels.

## How to Review

- Single file deletion: `.github/workflows/fix-size-check.yml`

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 20, 2026
…es#51958)

## Context

The permissions ceiling bug (fixed in zed-industries#51948) left two open PRs (zed-industries#51897,
zed-industries#50372) with failed `check-size` runs. The Check Runs API requires
GitHub App auth, so we can't post passing checks from the CLI — it needs
to run inside Actions with `checks: write`.

This adds a `workflow_dispatch` workflow that takes comma-separated PR
numbers, computes sizes, applies labels, and posts passing check runs.
Delete after use.

## How to Review

- Single file: `.github/workflows/fix-size-check.yml`
- Uses the same size logic and ignored patterns as `pr-size-check.yml`
- Input is `pr_numbers` (comma-separated integers), accessed via JS API,
not shell interpolation

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 20, 2026
## Context

Cleanup of the one-off workflow added in zed-industries#51958. Both affected PRs
(zed-industries#51897, zed-industries#50372) now have passing checks and correct size labels.

## How to Review

- Single file deletion: `.github/workflows/fix-size-check.yml`

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
toshmukhamedov pushed a commit to toshmukhamedov/zed that referenced this pull request Mar 20, 2026
…es#51958)

## Context

The permissions ceiling bug (fixed in zed-industries#51948) left two open PRs (zed-industries#51897,
zed-industries#50372) with failed `check-size` runs. The Check Runs API requires
GitHub App auth, so we can't post passing checks from the CLI — it needs
to run inside Actions with `checks: write`.

This adds a `workflow_dispatch` workflow that takes comma-separated PR
numbers, computes sizes, applies labels, and posts passing check runs.
Delete after use.

## How to Review

- Single file: `.github/workflows/fix-size-check.yml`
- Uses the same size logic and ignored patterns as `pr-size-check.yml`
- Input is `pr_numbers` (comma-separated integers), accessed via JS API,
not shell interpolation

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
toshmukhamedov pushed a commit to toshmukhamedov/zed that referenced this pull request Mar 20, 2026
## Context

Cleanup of the one-off workflow added in zed-industries#51958. Both affected PRs
(zed-industries#51897, zed-industries#50372) now have passing checks and correct size labels.

## How to Review

- Single file deletion: `.github/workflows/fix-size-check.yml`

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 23, 2026
…es#51958)

## Context

The permissions ceiling bug (fixed in zed-industries#51948) left two open PRs (zed-industries#51897,
zed-industries#50372) with failed `check-size` runs. The Check Runs API requires
GitHub App auth, so we can't post passing checks from the CLI — it needs
to run inside Actions with `checks: write`.

This adds a `workflow_dispatch` workflow that takes comma-separated PR
numbers, computes sizes, applies labels, and posts passing check runs.
Delete after use.

## How to Review

- Single file: `.github/workflows/fix-size-check.yml`
- Uses the same size logic and ignored patterns as `pr-size-check.yml`
- Input is `pr_numbers` (comma-separated integers), accessed via JS API,
not shell interpolation

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 23, 2026
## Context

Cleanup of the one-off workflow added in zed-industries#51958. Both affected PRs
(zed-industries#51897, zed-industries#50372) now have passing checks and correct size labels.

## How to Review

- Single file deletion: `.github/workflows/fix-size-check.yml`

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
@probably-neb probably-neb merged commit 733857b into zed-industries:main Apr 6, 2026
31 checks passed
@feitreim feitreim deleted the bugfix-repl-uv branch April 6, 2026 15:53
@zed-zippy zed-zippy bot added the PR state:needs review Used to label PRs that are in need of a post-merge approval label Apr 7, 2026
@probably-neb
Copy link
Copy Markdown
Collaborator

@zed-industries/approved

@MrSubidubi MrSubidubi removed the PR state:needs review Used to label PRs that are in need of a post-merge approval label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv installed venvs lack pip - ipykernel install fails

6 participants