Split preview mode into separate feature flags#14823
Merged
Conversation
30cf136 to
4d5134a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
I'll update the documentation separately. |
konstin
approved these changes
Jul 25, 2025
Comment on lines
120
to
125
| self.flags | ||
| .iter() | ||
| .map(PreviewFeatures::as_str) | ||
| .collect::<Vec<_>>() | ||
| .join(", ") | ||
| .fmt(f) |
Member
There was a problem hiding this comment.
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." |
Member
There was a problem hiding this comment.
We should be consistent on whether we use the name inline or as_str()
Member
Author
There was a problem hiding this comment.
I'd like to use as_str, thanks!
jtfmumm
reviewed
Jul 25, 2025
jtfmumm
reviewed
Jul 25, 2025
| pub fn is_enabled(&self) -> bool { | ||
| matches!(self, Self::Enabled) | ||
| impl PreviewFeatures { | ||
| pub fn as_str(self) -> &'static str { |
Contributor
There was a problem hiding this comment.
Should this str be capable of including more than one feature?
Contributor
There was a problem hiding this comment.
May be useful to have one or two unit tests
Member
Author
There was a problem hiding this comment.
No, it can't be. I updated it to clarify that.
jtfmumm
approved these changes
Jul 25, 2025
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 ([#​14934](astral-sh/uv#14934)) - Extend wheel filtering to Android tags ([#​14977](astral-sh/uv#14977)) - Perform wheel lockfile filtering based on platform and OS intersection ([#​14976](astral-sh/uv#14976)) - Clarify messaging when a new resolution needs to be performed ([#​14938](astral-sh/uv#14938)) ##### Preview features - Add support for extending package's build dependencies with `extra-build-dependencies` ([#​14735](astral-sh/uv#14735)) - Split preview mode into separate feature flags ([#​14823](astral-sh/uv#14823)) ##### Configuration - Add support for package specific `exclude-newer` dates via `exclude-newer-package` ([#​14489](astral-sh/uv#14489)) ##### Bug fixes - Avoid invalidating lockfile when path or workspace dependencies define explicit indexes ([#​14876](astral-sh/uv#14876)) - Copy entrypoints that have a shebang that differs in `python` vs `python3` ([#​14970](astral-sh/uv#14970)) - Fix incorrect file permissions in wheel packages ([#​14930](astral-sh/uv#14930)) - Update validation for `environments` and `required-environments` in `uv.toml` ([#​14905](astral-sh/uv#14905)) ##### Documentation - Show `uv_build` in projects documentation ([#​14968](astral-sh/uv#14968)) - Add `UV_` prefix to installer environment variables ([#​14964](astral-sh/uv#14964)) - Un-hide `uv` from `--build-backend` options ([#​14939](astral-sh/uv#14939)) - Update documentation for preview flags ([#​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-->
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.
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
--previewand--no-previewflags are retained as global overrides. A new--preview-featuresoption is added which accepts comma separated features or can be passed multiple times, e.g.,--preview-features add-bounds,pylock. There's aUV_PREVIEW_FEATURESenvironment variable for that option (I'm not sure if we should overloadUV_PREVIEW, but could be convinced).