Skip to content

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Jul 22, 2025

I think this would give us better hygiene than a global flag. It makes it easier for users to opt-in to overlapping features, such as Python upgrades and Python bin installations and to disable warnings for preview mode without opting in to a bunch of other features. In general, I want to reduce the burden for putting something under preview.

The --preview and --no-preview flags are retained as global overrides. A new --preview-features option is added which accepts comma separated features or can be passed multiple times, e.g., --preview-features add-bounds,pylock. There's a UV_PREVIEW_FEATURES environment variable for that option (I'm not sure if we should overload UV_PREVIEW, but could be convinced).

@zanieb zanieb temporarily deployed to uv-test-registries July 22, 2025 17:17 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/preview-flags branch from b0b3399 to 60a97ca Compare July 23, 2025 22:19
@zanieb zanieb temporarily deployed to uv-test-registries July 23, 2025 22:22 — with GitHub Actions Inactive
zanieb added a commit that referenced this pull request Jul 23, 2025
@zanieb zanieb force-pushed the zb/preview-flags branch 3 times, most recently from 30cf136 to 4d5134a Compare July 23, 2025 23:05
@zanieb zanieb temporarily deployed to uv-test-registries July 23, 2025 23:08 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/preview-flags branch from 4d5134a to 182c67b Compare July 23, 2025 23:28
@zanieb zanieb temporarily deployed to uv-test-registries July 23, 2025 23:29 — with GitHub Actions Inactive
@zanieb zanieb force-pushed the zb/preview-flags branch from 182c67b to 4a6b698 Compare July 24, 2025 00:06
@zanieb zanieb temporarily deployed to uv-test-registries July 24, 2025 00:09 — with GitHub Actions Inactive
@zanieb

This comment was marked as resolved.

@zanieb zanieb force-pushed the zb/preview-flags branch from 4a6b698 to 6b4a3b6 Compare July 24, 2025 00:58
@zanieb zanieb temporarily deployed to uv-test-registries July 24, 2025 01:00 — with GitHub Actions Inactive
@zanieb zanieb added configuration Settings and such preview Experimental behavior labels Jul 24, 2025
@zanieb zanieb marked this pull request as ready for review July 24, 2025 01:41
@zanieb
Copy link
Member Author

zanieb commented Jul 24, 2025

I'll update the documentation separately.

@zanieb zanieb requested review from jtfmumm and konstin July 24, 2025 22:26
Comment on lines 120 to 125
self.flags
.iter()
.map(PreviewFeatures::as_str)
.collect::<Vec<_>>()
.join(", ")
.fmt(f)
Copy link
Member

Choose a reason for hiding this comment

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

This should be in impl Display for PreviewFeatures.

warn_user_once!("The bounds option is in preview and may change in any future release.");
if bounds.is_some() && !preview.is_enabled(PreviewFeatures::ADD_BOUNDS) {
warn_user_once!(
"The `bounds` option is in preview and may change in any future release. Pass `--preview-features add-bounds` to disable this warning."
Copy link
Member

Choose a reason for hiding this comment

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

We should be consistent on whether we use the name inline or as_str()

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like to use as_str, thanks!

pub fn is_enabled(&self) -> bool {
matches!(self, Self::Enabled)
impl PreviewFeatures {
pub fn as_str(self) -> &'static str {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this str be capable of including more than one feature?

Copy link
Contributor

Choose a reason for hiding this comment

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

May be useful to have one or two unit tests

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it can't be. I updated it to clarify that.

@zanieb zanieb temporarily deployed to uv-test-registries July 25, 2025 15:52 — with GitHub Actions Inactive
@zanieb zanieb merged commit bfb4bc2 into main Jul 25, 2025
136 of 138 checks passed
@zanieb zanieb deleted the zb/preview-flags branch July 25, 2025 16:01
zanieb added a commit that referenced this pull request Jul 25, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 31, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.3` -> `0.8.4` |

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.8.4`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#084)

[Compare Source](astral-sh/uv@0.8.3...0.8.4)

##### Enhancements

- Improve styling of warning cause chains  ([#&#8203;14934](astral-sh/uv#14934))
- Extend wheel filtering to Android tags ([#&#8203;14977](astral-sh/uv#14977))
- Perform wheel lockfile filtering based on platform and OS intersection ([#&#8203;14976](astral-sh/uv#14976))
- Clarify messaging when a new resolution needs to be performed ([#&#8203;14938](astral-sh/uv#14938))

##### Preview features

- Add support for extending package's build dependencies with `extra-build-dependencies` ([#&#8203;14735](astral-sh/uv#14735))
- Split preview mode into separate feature flags ([#&#8203;14823](astral-sh/uv#14823))

##### Configuration

- Add support for package specific `exclude-newer` dates via `exclude-newer-package` ([#&#8203;14489](astral-sh/uv#14489))

##### Bug fixes

- Avoid invalidating lockfile when path or workspace dependencies define explicit indexes ([#&#8203;14876](astral-sh/uv#14876))
- Copy entrypoints that have a shebang that differs in `python` vs `python3` ([#&#8203;14970](astral-sh/uv#14970))
- Fix incorrect file permissions in wheel packages ([#&#8203;14930](astral-sh/uv#14930))
- Update validation for `environments` and `required-environments` in `uv.toml` ([#&#8203;14905](astral-sh/uv#14905))

##### Documentation

- Show `uv_build` in projects documentation ([#&#8203;14968](astral-sh/uv#14968))
- Add `UV_` prefix to installer environment variables ([#&#8203;14964](astral-sh/uv#14964))
- Un-hide `uv` from `--build-backend` options ([#&#8203;14939](astral-sh/uv#14939))
- Update documentation for preview flags ([#&#8203;14902](astral-sh/uv#14902))

</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:eyJjcmVhdGVkSW5WZXIiOiI0MS40NS4wIiwidXBkYXRlZEluVmVyIjoiNDEuNDUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Settings and such preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants