Skip to content

Conversation

@mscolnick
Copy link
Contributor

Summary

Fixes an issue where adding git dependencies via the UI (e.g., git+https://github.com/user/repo.git) would install the package successfully but fail to update the script's inline metadata with the required [tool.uv.sources] section.

Changes

  • Modified UvPackageManager.update_notebook_script_metadata() to detect and handle direct reference dependencies (git URLs, direct URLs, local paths)
  • Added _is_direct_reference() helper function to identify packages that should bypass the installed packages check
  • Direct references are now passed through to uv add --script which correctly creates the [tool.uv.sources] section

Closes #5545

## Summary

Fixes an issue where adding git dependencies via the UI (e.g., `git+https://github.com/user/repo.git`) would install the package successfully but fail to update the script's inline metadata with the required `[tool.uv.sources]` section.

## Changes

- Modified `UvPackageManager.update_notebook_script_metadata()` to detect and handle direct reference dependencies (git URLs, direct URLs, local paths)
- Added `_is_direct_reference()` helper function to identify packages that should bypass the installed packages check
- Direct references are now passed through to `uv add --script` which correctly creates the `[tool.uv.sources]` section

Closes #5545
@mscolnick mscolnick requested a review from dmadisetti as a code owner October 17, 2025 12:21
@vercel
Copy link

vercel bot commented Oct 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Oct 17, 2025 0:22am

Comment on lines +261 to +262
if "://" in package:
return True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Couldn't we do just this?

@mscolnick mscolnick merged commit 74b3602 into main Oct 17, 2025
36 of 77 checks passed
@mscolnick mscolnick deleted the ms/uv-git branch October 17, 2025 18:04
@dmadisetti dmadisetti added the bug Something isn't working label Oct 24, 2025
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.

Sandboxed git+ dependency is not added correctly

3 participants