Default to uv package manager when launched from uv#5213
Merged
dmadisetti merged 1 commit intomainfrom Jun 6, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
uv as default package manager when running within uv runuv as default package manager (instead of pip) when running within uv run
uv as default package manager (instead of pip) when running within uv runuv as default package manager (instead of pip) when launched from uv
`uv run` and `uv tool run` (aka `uvx`) sets `UV` environment var to the uv executable path. We feature detect this, rather than looking at the pyproject metadata.
5d92aac to
abd27c6
Compare
uv as default package manager (instead of pip) when launched from uvuv package manager when launched from uv
dmadisetti
approved these changes
Jun 6, 2025
Collaborator
dmadisetti
left a comment
There was a problem hiding this comment.
LGTM discussed a bit out of scope too, where UV is not in path- but maybe this could be mitigated by making uv a dep
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.13.16-dev48 |
Light2Dark
pushed a commit
that referenced
this pull request
Jun 9, 2025
## 📝 Summary Fixes #5185. Changes the default package manager to `uv` when marimo is launched from `uv` executable (e.g., `uv run marimo` in a project, or `uvx marimo`). Expect behavior with this PR (without setting a package manager): ```py # prefers uv when launched from uv uv init foo && cd foo uv add marimo uv run marimo edit test.py # prefers pip when inside the environment source .venv/bin/activate marimo edit test.py ``` ```py # prefers uv when run with `uvx` uvx marimo ``` We could probably try to be smarter in the case above where it defaults to `pip` (since `uv` environments don't have `pip` installed), but I think this is the safest and has the nice property of the `uvx marimo` for the first time use case preferring uv. ## 🔍 Description of Changes `uv run` and `uv tool run` (aka `uvx`) sets `UV` to the `uv` executable path (astral-sh/uv#11326), which we inspect to infer the preferred default package. I think it's probably most safe to infer the "preferred" package manager is `uv` when running from inside uv, so this bypasses the `pyproject.toml` inspection. ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected. ## 📜 Reviewers @akshayka
sebbeutler
pushed a commit
to sebbeutler/marimo
that referenced
this pull request
Jun 28, 2025
…5213) ## 📝 Summary Fixes marimo-team#5185. Changes the default package manager to `uv` when marimo is launched from `uv` executable (e.g., `uv run marimo` in a project, or `uvx marimo`). Expect behavior with this PR (without setting a package manager): ```py # prefers uv when launched from uv uv init foo && cd foo uv add marimo uv run marimo edit test.py # prefers pip when inside the environment source .venv/bin/activate marimo edit test.py ``` ```py # prefers uv when run with `uvx` uvx marimo ``` We could probably try to be smarter in the case above where it defaults to `pip` (since `uv` environments don't have `pip` installed), but I think this is the safest and has the nice property of the `uvx marimo` for the first time use case preferring uv. ## 🔍 Description of Changes `uv run` and `uv tool run` (aka `uvx`) sets `UV` to the `uv` executable path (astral-sh/uv#11326), which we inspect to infer the preferred default package. I think it's probably most safe to infer the "preferred" package manager is `uv` when running from inside uv, so this bypasses the `pyproject.toml` inspection. ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected. ## 📜 Reviewers @akshayka
sebbeutler
pushed a commit
to sebbeutler/marimo
that referenced
this pull request
Jul 7, 2025
…5213) ## 📝 Summary Fixes marimo-team#5185. Changes the default package manager to `uv` when marimo is launched from `uv` executable (e.g., `uv run marimo` in a project, or `uvx marimo`). Expect behavior with this PR (without setting a package manager): ```py # prefers uv when launched from uv uv init foo && cd foo uv add marimo uv run marimo edit test.py # prefers pip when inside the environment source .venv/bin/activate marimo edit test.py ``` ```py # prefers uv when run with `uvx` uvx marimo ``` We could probably try to be smarter in the case above where it defaults to `pip` (since `uv` environments don't have `pip` installed), but I think this is the safest and has the nice property of the `uvx marimo` for the first time use case preferring uv. ## 🔍 Description of Changes `uv run` and `uv tool run` (aka `uvx`) sets `UV` to the `uv` executable path (astral-sh/uv#11326), which we inspect to infer the preferred default package. I think it's probably most safe to infer the "preferred" package manager is `uv` when running from inside uv, so this bypasses the `pyproject.toml` inspection. ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] I have added tests for the changes made. - [x] I have run the code and verified that it works as expected. ## 📜 Reviewers @akshayka
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
Fixes #5185. Changes the default package manager to
uvwhen marimo is launched fromuvexecutable (e.g.,uv run marimoin a project, oruvx marimo). Expect behavior with this PR (without setting a package manager):We could probably try to be smarter in the case above where it defaults to
pip(sinceuvenvironments don't havepipinstalled), but I think this is the safest and has the nice property of theuvx marimofor the first time use case preferring uv.🔍 Description of Changes
uv runanduv tool run(akauvx) setsUVto theuvexecutable path (astral-sh/uv#11326), which we inspect to infer the preferred default package.I think it's probably most safe to infer the "preferred" package manager is
uvwhen running from inside uv, so this bypasses thepyproject.tomlinspection.📋 Checklist
📜 Reviewers
@akshayka