Set UV to the uv executable path#11326
Merged
zanieb merged 5 commits intotracking/060from Feb 7, 2025
Merged
Conversation
zanieb
commented
Feb 7, 2025
Member
Author
|
Technically, this could be breaking as we'll now overwrite We could avoid setting it in that case? But it also seems correct to set it? |
BurntSushi
reviewed
Feb 7, 2025
BurntSushi
approved these changes
Feb 7, 2025
Member
BurntSushi
left a comment
There was a problem hiding this comment.
Perfect. You made the soundness pedant inside of me happy. :-)
Member
Author
|
Going to consider this breaking due to the overwrite possibility and the change of our |
Gankra
approved these changes
Feb 7, 2025
Merged
charliermarsh
pushed a commit
that referenced
this pull request
Feb 7, 2025
charliermarsh
pushed a commit
that referenced
this pull request
Feb 10, 2025
Gankra
pushed a commit
that referenced
this pull request
Feb 12, 2025
zanieb
added a commit
that referenced
this pull request
Feb 13, 2025
zanieb
added a commit
that referenced
this pull request
Feb 13, 2025
zanieb
added a commit
that referenced
this pull request
Feb 13, 2025
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Feb 17, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | minor | `0.5.31` -> `0.6.0` | 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 (astral-sh/uv)</summary> ### [`v0.6.0`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#060) [Compare Source](astral-sh/uv@0.5.31...0.6.0) There have been 31 releases and 1135 pull requests since [0.5.0](https://github.com/astral-sh/uv/releases/tag/0.5.0), our last release with breaking changes. As before, we've accumulated various changes that improve correctness and user experience, but could break some workflows. This release contains those changes; many have been marked as breaking out of an abundance of caution. We expect most users to be able to upgrade without making changes. ##### Breaking changes - **Create `main.py` instead of `hello.py` in `uv init`** ([#​10369](astral-sh/uv#10369)) Previously, `uv init` created a `hello.py` sample file. Now, `uv init` will create `main.py` instead — which aligns with expectations from user feedback. The `--bare` option can be used to avoid creating the file altogether. - **Respect `UV_PYTHON` in `uv python install`** ([#​11487](astral-sh/uv#11487)) Previously, `uv python install` did not read this environment variable; now it does. We believe this matches user expectations, however, this will take priority over `.python-version` files which could be considered breaking. - **Set `UV` to the uv executable path** ([#​11326](astral-sh/uv#11326)) When uv spawns a subprocess, it will now have the `UV` environment variable set to the `uv` binary path. This change is breaking if you are setting the `UV` environment variable yourself, as we will overwrite its value. Additionally, this change requires marking the uv Rust entrypoint (`uv::main`) as `unsafe` to avoid unsoundness — this is only relevant if you are invoking uv using Rust. See the [Rust documentation](https://doc.rust-lang.org/std/env/fn.set_var.html#safety) for details about the safety of updating a process' environment. - **Error on non-existent extras, e.g., in `uv sync`** ([#​11426](astral-sh/uv#11426)) Previously, uv would silently ignore non-existent extras requested on the command-line (e.g., via `uv sync --extra foo`). This is *generally* correct behavior when resolving requests for package extras, because an extra may be present on one compatible version of a package but not another. However, this flexibility doesn't need to apply to the local project and it's less surprising to error here. - **Error on missing dependency groups when `--frozen` is provided** ([#​11499](astral-sh/uv#11499)) Previously, uv would not validate that the requested dependency groups were present in the lockfile when the `--frozen` flag was used. Now, an error will be raised if a requested dependency group is not present. - **Change `-p` to a `--python` alias in `uv pip compile`** ([#​11486](astral-sh/uv#11486)) In `uv pip compile`, `-p` was an alias for `--python-version` while everywhere else in uv's interface it is an alias for `--python`. Additionally, `uv pip compile` did not respect the `UV_PYTHON` environment variable. Now, the semantics of this flag have been updated for parity with the rest of the CLI. However, `--python-version` is unique: if we cannot find an interpreter with the given version, we will not fail. Instead, we'll use an alternative interpreter and override its version tags with the requested version during package resolution. This behavior is retained here for backwards compatibility, `--python <version>` / `-p <version>` will not fail if the version cannot be found. However, if a specific interpreter is requested, e.g., with `--python <path>` or `--python pypy`, and cannot be found — uv will exit with an error. The breaking changes here are that `UV_PYTHON` is respected and `--python <version>` will no longer fail if the version cannot be found. - **Bump `alpine` default tag to 3.21 for derived Docker images** ([#​11157](astral-sh/uv#11157)) Alpine 3.21 was released in Dec 2024 and is used in the official Alpine-based Python images. Our `uv:python3.x-alpine` images have been using 3.21 since uv v0.5.8. However, now the the `uv:alpine` image will use 3.21 instead of 3.20 and `uv:alpine3.20` will no longer be updated. - **Use files instead of junctions on Windows** ([#​11269](astral-sh/uv#11269)) Previously, we used junctions for atomic replacement of cache entries on Windows. Now, we use a file with a pointer to the cache entry instead. This resolves various edge-case behaviors with junctions. These files are only intended to be consumed by uv and the cache version has been bumped. We do not think this change will affect workflows. ##### Stabilizations - **`uv publish` is no longer in preview** ([#​11032](astral-sh/uv#11032)) This does not come with any behavior changes. You will no longer see an experimental warning when using `uv publish`. See the linked pull request for a report on the stabilization. ##### Enhancements - Support `--active` for PEP 723 script environments ([#​11433](astral-sh/uv#11433)) - Add `revision` to the lockfile to allow backwards-compatible metadata changes ([#​11500](astral-sh/uv#11500)) ##### Bug fixes - Avoid reading metadata from `.egg-info` files ([#​11395](astral-sh/uv#11395)) - Include archive bucket version in archive pointers ([#​11306](astral-sh/uv#11306)) - Omit lockfile version when additional fields are dynamic ([#​11468](astral-sh/uv#11468)) - Respect executable name in `uvx --from tool@latest` ([#​11465](astral-sh/uv#11465)) ##### Documentation - The `CHANGELOG.md` is now split into separate files for each "major" version to fix rendering ([#​11510](astral-sh/uv#11510)) </details> --- ### Configuration 📅 **Schedule**: 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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzAuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE3MC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
loic-lescoat
pushed a commit
to loic-lescoat/uv
that referenced
this pull request
Mar 2, 2025
4 tasks
dmadisetti
pushed a commit
to marimo-team/marimo
that referenced
this pull request
Jun 6, 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
Light2Dark
pushed a commit
to marimo-team/marimo
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.
Closes #8775